Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: a regex pattern how to understandby hexcoder (Curate) |
on Jul 09, 2015 at 08:21 UTC ( [id://1133910]=note: print w/replies, xml ) | Need Help?? |
Hello,
try this instead while ( $text =~ m<Name:\s+([[:alpha:] ]+?)\s*Age:\s+(\d+)>g ) { I changed the \s+Age part to \s*Age, since the space before 'Age' is already consumed by the previous construct, and so it is here not available anymore.
In Section
Seekers of Perl Wisdom
|
|