Re: Assigning pattern matches to an array




"DJ Stunks" <DJStunks@xxxxxxxxx> wrote in message
news:1167506565.933525.68510@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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


Emaill::Address doesn't grab me
Done a quick test between
use Email::Address
push(@matches, Email::Address->parse($line));
and
push(@matches, $line=~/\b[.-\w]*@[-\w]*\.+[-\w]*\.*[-\w]*\b/g);
The latter pulled up a number of correct email address, while the former
pulled these up plus other stuff that weren't true email addresses
Graham


.



Relevant Pages

  • 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. ... The latter pulled up a number of correct email address, ...
    (comp.lang.perl.misc)
  • Re: F-16 landing speed
    ... For the benefit of TW and PPL-holders, tactical aircraft fly an ... "overhead" pattern rather than the conventional box. ... The objective is to roll out on downind after a 180 slowed to gear ... The accelerated stall in the Talon was a rattle or buzzing ...
    (rec.aviation.military)
  • Re: joggling, or not
    ... Was losing BB's continually, esp. ... and being lighter, they roll even worse. ... Downhill, I can't even catch ... Have to learn a different grip, spread the pattern ...
    (rec.juggling)
  • Re: Greg Kennedy doing 9 balls in cone
    ... length of one throw is based on it's roll time which remains a constant - ... slower it would not just alter the speed through the pattern, ...
    (rec.juggling)
  • Re: Poor, poor words
    ... sentences such as "The car needs washed", ... I have heard that this pattern ... roll their 'r's). ... Considering how much geographical variation there can be within one US ...
    (rec.arts.sf.composition)