Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: How to print the qr regex to the stdout?by ikegami (Patriarch) |
on Feb 28, 2022 at 17:45 UTC ( [id://11141711]=note: print w/replies, xml ) | Need Help?? |
Stringification of a compiled regex produces something that can be used in other qr//, m// or s/// without changing the meaning of the pattern. Adding (?^:...) or similar is necessary to achieve that.
That said, you can get the unmodified pattern (and the flags) using re's re::regexp_pattern.
You can rebuild the original compiled regex using the following:
In Section
Seekers of Perl Wisdom
|
|