in reply to regex greedy range
Well, if you want to capture all the parts, then, well capture all the parts.
my @input = qw( A/B/C/D/E/F/ A/B/C/D/ A/B/C/D A/B/C/ A/B/C A/B A ); foreach (@input){ next if not m!((((\w+/)\w+/)\w+/)\w+/?)!; print "$_ has $4 $3 $2 $1\n"; }
Misread the question…
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: regex greedy range
by ikegami (Patriarch) on Sep 16, 2004 at 23:40 UTC | |
by Aristotle (Chancellor) on Sep 16, 2004 at 23:47 UTC |