in reply to Capturing RegExp Matches

Are you talking about something like that:
#!/usr/bin/perl -w use strict; my $page = <<__EOT; jksjdsjk some\@one.com nnbcx jdsjl;'pejbkscd (aaa\@bbb.com) sdkmlsd __EOT my @emails = ($page =~ /\b\S+?\@\S+?\b/gs); foreach (@emails) { print "$_\n"; }

--dda

Replies are listed 'Best First'.
Re: Re: Capturing RegExp Matches
by Chady (Priest) on Jul 03, 2002 at 13:33 UTC

    Your code is choking on it's own data.

    you are matching the word boundary . before the .com and it's getting stripped out.

    you cannot filter an email address with one simple regex.


    He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

    Chady | http://chady.net/
      Ohh, stupid me :) Thanks.

      --dda