|Right, and that's what it turned out Alan was trying to do in the first
|place:  Find a phrase that may contain delimiters, set off by delimiters
|on either side of it.  I would have changed "word" to "phrase" except
|that I was leaving as much of his code intact as possible to make it
|easy to compare.
|
|My solution is equivalent to his, just without the need to choose a safe
|character to substitute for the target phrase.  Note that neither will
|find a phrase that starts or ends with a word delimiter that abuts
|another word.  In Alan's example of searching for A(I), he wouldn't find
|it in the context A(I)B(J).  To handle cases like that, you'd test the
|first and last characters of the phrase, and omit the appropriate VERIFY
|stage when either is in the list of word delimiters.

Correct, I'm not really looking for words in the usual sense, or phrases
exactly. I cannot simply "split everything up into words",
because what I am searching for may contain word-separators.

Thank you for your solution, which is better than mine.

And thank you for pointing out the example of A(I)B(I). I don't think that's
valid FORTRAN, but it is valid REXX. I haven't figured out what to do
with it, but I would like to be able to find A(I) and/or B(I) in this case,
too.


Alan Ackerman
Alan (dot) Ackerman (at) Bank of America (dot) com

Reply via email to