![]() |
|
Perl-Sensitive Sunglasses | |
PerlMonks |
Re: Capturing RegExp Matchesby arturo (Vicar) |
on Jul 03, 2002 at 13:38 UTC ( #179155=note: print w/replies, xml ) | Need Help?? |
The general answer to this sort of problem is to use capturing parentheses in your regex in combination with the /g operator:
The /g modifier returns all the matches in the string, so those match operators return a list of the matching parts of the string. However, as a read through the Perl FAQ (or even on this site for, say "Email Address") will reveal, using regexes to match email addresses is a dicey issue in the first place. I mistrust all systematizers and avoid them. The will to a system shows a lack of integrity -- F. Nietzsche
In Section
Seekers of Perl Wisdom
|
|