in reply to Irregular expression evaluation
use warnings; use strict; gf (); gf (); sub gf { my $ins1 = '4 A -4 C -4 B 1 D'; our @inserts = (); $ins1 =~ /[\d+-]+(?: \w ([\d+-]+)(?{push @inserts, $1}))*/g; print "\n" . join ' ', @inserts; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Irregular expression evaluation
by pg (Canon) on Oct 24, 2005 at 03:46 UTC | |
|
Re^2: Irregular expression evaluation
by Roy Johnson (Monsignor) on Oct 24, 2005 at 20:31 UTC |