in reply to Irregular expression evaluation
And you probably have this already if you're benchmarking, but I suspect /g probably is the right way to go:
use warnings; use strict; gf (); gf (); sub gf { my $ins1 = '4 A -4 C -4 B 1 D'; my @inserts; $ins1 =~ /^[\d+-]+/g; push @inserts, $ins1 =~ /\G(?: \w ([\d+-]+))/g; print join(' ', @inserts), "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Irregular expression evaluation
by GrandFather (Saint) on Oct 25, 2005 at 01:28 UTC |