in reply to Re^3: Regex troubles...
in thread Regex troubles...
That doesn't seem to yield any output that I can understand. Why three 'b1' 'b2' 'b3' from ab1b2b3b4d and nothing from any of the others?
c:\@Work\Perl\monks>perl -e "use warnings; use strict; use feature qw{ say }; ;; for my $string (qw(ab1b2b3b4d ab5b6b7d ab8b9d abxd ad)) { my @two; my @matches = $string =~ /(a) (b.(?{ push @two, $2 if defined $2 }))+ (d)/x; say for @matches, '---', @two, '======'; } " a b4 d --- b1 b2 b3 ====== a b7 d --- ====== a b9 d --- ====== a bx d --- ====== --- ======
Update: "This is perl 5, version 14, subversion 4 (v5.14.4) built for MSWin32-x86-multi-thread"
Give a man a fish: <%-{-{-{-<
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Regex troubles...
by choroba (Cardinal) on Apr 23, 2016 at 19:28 UTC | |
by AnomalousMonk (Archbishop) on Apr 23, 2016 at 19:57 UTC | |
by choroba (Cardinal) on Apr 23, 2016 at 20:26 UTC | |
by AnomalousMonk (Archbishop) on Apr 23, 2016 at 20:52 UTC | |
by AnomalousMonk (Archbishop) on Apr 23, 2016 at 20:45 UTC | |
|
Re^5: Regex troubles...
by Anonymous Monk on Apr 23, 2016 at 19:56 UTC | |
by AnomalousMonk (Archbishop) on Apr 23, 2016 at 20:16 UTC | |
by choroba (Cardinal) on Apr 23, 2016 at 20:32 UTC | |
by AnomalousMonk (Archbishop) on Apr 23, 2016 at 21:56 UTC | |
by Anonymous Monk on Apr 23, 2016 at 20:20 UTC | |
by Anonymous Monk on Apr 23, 2016 at 20:29 UTC |