in reply to How to print the qr regex to the stdout?
It adds the ?^: at the start. What is the proper way to get rid of it?
Try Data::Dump pp to serialize regex or something from re or B to get original qr
maybe use https://perldoc.perl.org/re#regexp_pattern($ref)
my ($pat, $mods) = regexp_pattern($ref); my $parentless = ( $pat =~ m/[^:]+:(.*?)\)$/s )[0];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to print the original qr regex to the stdout?
by ovedpo15 (Pilgrim) on Feb 28, 2022 at 10:38 UTC | |
by Anonymous Monk on Feb 28, 2022 at 13:55 UTC | |
by LanX (Saint) on Feb 28, 2022 at 14:26 UTC |