Hi Shawn,
welcom to the forum.
your script returns true because "." has a special meaning in regular expressions. And that is what matchText is using. I find regular expressions (or regex) difficult, because the syntax is, well, difficult for me. Look in the dictionary and the user guide for some hints on regular expressions. And than there is in the plugins section of the development menu a plug-in Regex-builder by Frédéric Rinaldi. I use that for building regular expressions, and often it works. In your case I went to this plug-in and got this:
Code: Select all
answer MatchText(CurrentWord,"(\.)")
and this worked for me. the backslash tells the regular expression to escape = take literally the period that follows. Otherwise a period means any single character.
From the user guide p. 184
. matches any single character (except a linefeed)
A.C matches "ABC" or "AGC", but not "AC" or "ABDC"
Depending on what you want you might also look at the offset function. This function looks for plain text. And can be used repeatedly to find all occurences if you set the charsToSkip variable.
If you need help with this just post your questions.
regards
Bernd
PS There are people here on the forum who know a lot more about regular expressions then I do, but I thought I give it a try to get you going with your script.
