> Richard H. wrote:
> I need to replace only exact true words, though.
> So I need to be able to take an input string such as
> 5*pay - 2*monthlypay
> and be able to replace “pay" with
> getVal(pay,,,debtor)
> without replacing monthlypay.
You could try the following (works for me).
Put a three-char string that's not in inString into X, e.g.
put "yap" into X
repeat for each line L in inString
repeat while \
matchChunk(L,"(?i)(^|\W)(pay)($|\W)",p1,p2,p3,p4,p5,p6)
put X into char p3 to p4 of L -- replaces pay
end repeat
put cr & L after outString
end repeat
replace X with "getVal(pay,,,debtor)" in outString
This finds case-insensitive exactly the trueWord "pay".
_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode