Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: How to strip comments and whitespace from a regex defined with /x?

by ikegami (Patriarch)
on Jan 21, 2018 at 18:53 UTC ( [id://1207637]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1207637]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2024-04-23 09:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found