it is certainly possible to use regexes to do that
As long as (?{ }) and (??{ }) aren't supported.
Maybe some other monk(s) will be able to suggest a better solution
You could have Perl compile the pattern and recreate the pattern from the compiled form. This could require maintenance every time Perl is upgraded. Then again, same goes for writing your own parser.
In reply to Re^2: How to strip comments and whitespace from a regex defined with /x?
by ikegami
in thread How to strip comments and whitespace from a regex defined with /x?
by jh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |