in reply to Re^4: Regex troubles...
in thread Regex troubles...
This one works for me.
#!/usr/bin/perl use warnings; use strict; for my $string (qw(ab1b2b3b4d ab5b6b7d ab8b9d abxd ad)) { my @two; my @matches = $string =~ /(a) (?:(b.)(?{ push @two, $2 }))+ (d)/x; @matches and splice @matches, 1, 1, @two; print "@matches\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Regex troubles...
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 |