RegEx difficulties

Ken Ray kray at sonsothunder.com
Wed Oct 1 14:12:01 EDT 2003


> 	if matchChunk(tStoryText, "(" & tWord & ")", 
> tStartChar, tEndChar) then
>          set the textStyle of char tStartChar to tEndChar of 
> field "myText" to empty
>     	end if
> 
> I need a RegEx string that will match only the whole word.  
> Kind of like the wholeMatches property works with the offset 
> functions.  Is this possible?

You better believe it, Chris. You can use the "\b" command which means
"word boundary", like this:

  if matchChunk(tStoryText,"\b(" & tWord & ")\b",tStartChar,tEndChar)
then


Have fun!

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





More information about the use-livecode mailing list