Good idea. It reminds me of a similar idea that is at the heart of many parsers. You make your regex of the form (things to be left alone)|(things to mangle), for example:
s{ ( [(] [^()]* [)] ) # Leave text in parens alone | <(\w+)> # Replace <word> with $replace{word} }{ $1 ? $1 : $replace($2) }gex;
- tye
In reply to Re^2: Anchors, bleh :( (regex alts)
by tye
in thread Anchors, bleh :(
by oko1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |