in reply to Re^3: next if attempt
in thread next if attempt
Note that sorting on length is only correct as long as you don't have regex quantifier expressions in the "words" - if you do, all bets are off. At any rate, if you're going to this effort, you should probably be using Regex::PreSuf.my $stopmatch = join '|', sort { length $b <=> length $a } qw(car pet carpet); $stopmatch = qr/\b(?:$stopmatch)\b/;
Makeshifts last the longest.
|
|---|