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; }
In reply to Re: Irregular expression evaluation
by chester
in thread Irregular expression evaluation
by GrandFather
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |