bordemstirs
Member
I have a matcher for API that I run line by line, and some lines don't have any data after the " => " part (pieces that go into a new array, for instance)
I'm fairly certain that the matcher isn't designed wrong, as it works fine on everything, but that print seems to suggest that what should be an empty string is really "0".
Code:
m=create_matcher("\\'?(\\w+)\\'? => (?:\\'?(.+?)\\'?,)?",line);
if (!m.find())continue;
print(m.group(2));
if (m.group(2)==""){
mainArray[cd,m.group(1)]="NARRAY:"+to_string(count(mainArray)+1);
}else{
mainArray[cd,m.group(1)]=m.group(2);
}
}
I'm fairly certain that the matcher isn't designed wrong, as it works fine on everything, but that print seems to suggest that what should be an empty string is really "0".