in reply to Re: How to strip comments and whitespace from a regex defined with /x?
in thread How to strip comments and whitespace from a regex defined with /x?

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.