Hello fellow monks,
I've got this apparently silly question, to which I didn't find any info anywhere.
Basically I've got this regex:
my $regex = qr/foo\d+|bar\S+?/;So when I want to match it on a string:
$_ =~ m/($regex)/;how can I get returned in the $1 the pattern instead of the matched part of the string??
Thanks for any kind help you will give me!
In reply to Regex: return the pattern instead of the actual match by Deus Ex
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |