in reply to Lost JJC and XML

Untested but think your regex (line 67) will have to parenthesize the various phrases and words to make the alternation work as you expect.

re syntax errors at lines 74, 79, 84 & 92, looks like you are failing to close the paren around the conditional (ie, paren missing right after the regex) before beginning the block.

...and if it's not rude curiosity, what's "JJC"