in reply to looping regex

Rather than re-inventing this particular wheel, you could try Regexp::Common::Email::Address

In the description you will find the words: "Don't worry, it's fast."

Cheers,
Darren :)

Replies are listed 'Best First'.
Re^2: looping regex
by ninja_byte (Acolyte) on Apr 11, 2006 at 02:06 UTC
    Thanks! Immediately after I posted, I was able to work out a solution:

    my @test_text = $filetext =~ m/([\w\-._+]+\@[\w\-.]+)/gmx; if (scalar @test_text > 50) { #success! }

    I think I'll play around with that module though. I sometimes forget how awesome CPAN is.
    ;-)
    mC
      You don't need to populate an array just to get a count of the times the pattern matches.
      my $count = () = $filetext =~ /[\w._+-]+\@[\w.-]+/g; if ( $count > 50 ) { #success! }