in reply to how to use string RE (against $_ and capture)
Here's my take:
c:\@Work\Perl\monks>perl -wMstrict -le "my $re_obj = qr{([0-6BS])}; my $re_str = '' . $re_obj; print $re_str; ;; if ('ABC' =~ $re_str) { print qq{match, \$1 captured '$1'}; } else { print 'no match'; } " (?^:([0-6BS])) match, $1 captured 'B'
Give a man a fish: <%-{-{-{-<
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to use string RE (against $_ and capture)
by perl-diddler (Chaplain) on Nov 08, 2016 at 02:20 UTC | |
by AnomalousMonk (Archbishop) on Nov 08, 2016 at 04:19 UTC | |
by perl-diddler (Chaplain) on Nov 08, 2016 at 04:30 UTC | |
by AnomalousMonk (Archbishop) on Nov 08, 2016 at 05:21 UTC | |
by dave_the_m (Monsignor) on Nov 08, 2016 at 08:54 UTC |