use strict; use warnings; my $match=0; while(<DATA>){ while(my $text = /Name: *(\w+)/g){ ++$match; print "Match no. $match is $1\n"; } } __DATA__ Name: Alpha Name: Beta Name: Gamma Name: Epsilon Name: Delta
In reply to Re^2: global regex
by biohisham
in thread global regex
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |