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.
In reply to Re: regex greedy range
by Aristotle
in thread regex greedy range
by johnnywang
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |