matchText returning where the match was
Posted: Mon Jan 11, 2010 4:23 pm
Right now matchText simply returns true or false indicating that the regular expression did - indeed - find a match somewhere in the input string. It would be extremely helpful to know where in the string the match was found. The best that's possible right now is to use matchText in conjuction with find, but that can yield false-positives. For example:
But that doesn't work, because the find command will match "blahifblah", whereas the matchText won't.
Jeff M.
Code: Select all
local tFoundText
if matchText(field "Whatever", "(\bif\b)", tFoundText) is true then
find tFoundText in field "Whatever"
end if
Jeff M.