RegEx difficulties

Chris Sheffield revlist at cableone.net
Wed Oct 1 13:47:01 CDT 2003


I'm using the matchChunk function to search for given words in a field and
then change the textStyle of those words to link.  I'm having a problem
though when a given word is found in another, longer word.  An example would
be "match" and "matches".  The word I'm searching for is "match" but I only
want to find "match", not "matches".

My code is

	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?

Chris Sheffield
Software Development
Read Naturally
csheffield at readnaturally.com







More information about the use-livecode mailing list