A better find and replace function

Robert Sneidar bobs at twft.com
Thu Sep 28 16:53:20 EDT 2006


Hmmm nice. I have not quite figured out regular expressions yet. I  
will have a look at them again. I did need a function so I could  
exclude comment lines which might inadvertently look for things I am  
trying to replace (like empty with foxEMPTY in my Foxpro Functions  
library). Still, regular expressions look like they can eliminate the  
bulk of my programming. It was such a nice function too!

Bob Sneidar
IT Manager
Logos Management
Calvary Chapel CM

>> 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