Re: Assigning pattern matches to an array



Graham Stow wrote:
push(@matches, $line=~/\b\w+@\w+\b/g); did it for me
The pattern doesn't match an email address, but I can work on that...

well, for one thing, the \w metacharacter doesn't match a literal .

don't roll your own email address regexp.

perldoc Email::Address

-jp

.



Relevant Pages

  • Re: Assigning pattern matches to an array
    ... Graham Stow wrote: ... The pattern doesn't match an email address, but I can work on that... ... well, for one thing, the \w metacharacter doesn't match a literal. ... pulled these up plus other stuff that weren't true email addresses ...
    (comp.lang.perl.misc)
  • Re: Assigning pattern matches to an array
    ... The pattern doesn't match an email address, but I can work on that... ... well, for one thing, the \w metacharacter doesn't match a literal. ... don't roll your own email address regexp. ... Graham ...
    (comp.lang.perl.misc)
  • Re: Regex puzzler!
    ... Your small error is forgetting that the question mark is a ... metacharacter. ... See the perlre documentation. ... Your medium error is misusing the syntax of the m// pattern match ...
    (perl.beginners)
  • [PS] User Guide p.79
    ... It matches 0 or 1 occurences of the preceding character or ... pattern, not as stated. ... Also the + metacharacter has been, I assume inadvertently, omitted ...
    (microsoft.public.windows.server.scripting)