I removed chr very soon after posting. Also, I was wondering why you had used \Z instead of \z. Frankly, though I know they're considered the modern anchors to use, I still find $ more immediately recognizeable and less confusing than \Z and \z.
The set of graphic characters that must be escaped is exactly { '"', '\', '^' }. The caret is the oddball. I think it's a carryover from another, different context in which control codes can be specified as two characters; e.g., ^Z. Though such control code sequences never occur in the text I'm lexing (they're represented instead as UCNs; e.g., \u001a), all literals carets in the text are nonetheless escaped (needlessly).
Thanks again.
In reply to Re^6: Regex Parsing Style
by Jim
in thread Regex Parsing Style
by Jim
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |