Code: Select all
local tFoundText
if matchText(field "Whatever", "(\bif\b)", tFoundText) is true then
find tFoundText in field "Whatever"
end if
Jeff M.
Moderator: Klaus
Code: Select all
local tFoundText
if matchText(field "Whatever", "(\bif\b)", tFoundText) is true then
find tFoundText in field "Whatever"
end if
massung wrote: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.Code: Select all
local tFoundText if matchText(field "Whatever", "(\bif\b)", tFoundText) is true then find tFoundText in field "Whatever" end if
Jeff M.