A better find and replace function

Ken Ray kray at sonsothunder.com
Thu Sep 28 02:43:36 EDT 2006


On 9/28/06 1:12 AM, "Robert Sneidar" <bobs at twft.com> wrote:

> What I needed was something that would replace the WORD blah with the
> WORD noblah, ignoring words that CONTAIN blah, including subsequent
> search and replace executions.

Bob, you can use replaceText with regular expressions to get the same thing:

  put replaceText(tString,"\bblah\b","noblah")

This causes it to match by "word boundaries" on either side, so it won't
replace "blah" inside words, among other things, which affects subsequent
replacement executions...


Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list