Re: regex question in matchChunk function

2009-12-17 Thread Chris Sheffield
Thanks to all who replied and offered suggestions. I ended up using the find command on my field in order to accomplish what I need. While probably not super speedy, it seems to be working well. Fortunately the story passages are not too long, so the decreased speed is really not that

Re: regex question in matchChunk function

2009-12-17 Thread zryip theSlug
It seems that I have missed the good tread. Apologizes if it's a double message ;) To enclose a word without its punctuation you have to define a list of substitute strings like this : - the list of possible form w ,w,,w.,.w,.w. - the substitute list boxw/box

regex question in matchChunk function

2009-12-15 Thread Chris Sheffield
I am not very familiar with regular expressions, and I'm wondering if someone more knowledgeable could give me a hint as to how to accomplish this. Given a passage of text, I need to find every instance of certain words within that text and draw a box around them. The box drawing I can handle

Re: regex question in matchChunk function

2009-12-15 Thread Troy Rollins
On Dec 15, 2009, at 1:46 PM, Chris Sheffield wrote: Can anyone help? Is there a way to do this? Or can someone recommend another method of accomplishing the same thing? Offset -- Troy RPSystems, Ltd. http://www.rpsystems.net ___ use-revolution

Re: regex question in matchChunk function

2009-12-15 Thread dunbarx
I am not either. but: on mouseup get fld yourField repeat with y = 1 to the number of words in it if word y of it = yourtext then set the textstyle of word y of fld yourField to box end repeat end mouseup Now this writes to fld yourfield every time it matches. I think if

Re: regex question in matchChunk function

2009-12-15 Thread Chris Sheffield
Thanks, Troy. Unfortunately, offset doesn't quite work for me, as it does not honor the wholeMatches property. So I might search for use, and it would find both use and used, which is not the desired result. However, with some extra code I could probably make it work (manually checking for

Re: regex question in matchChunk function

2009-12-15 Thread Peter Brigham MD
Here is one way. These are utility functions I use constantly for text processing. Offsets(str,cntr) returns a comma-delimited list of all the offsets of str in ctnr. Lineoffsets(str,cntr) does the same with lineoffsets. Then you can interate over the list of offsets to do whatever you

Re: regex question in matchChunk function

2009-12-15 Thread J. Landman Gay
Chris Sheffield wrote: I am not very familiar with regular expressions, and I'm wondering if someone more knowledgeable could give me a hint as to how to accomplish this. Given a passage of text, I need to find every instance of certain words within that text and draw a box around them. All