in reply to Re: looping regex
in thread looping regex

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

Replies are listed 'Best First'.
Re^3: looping regex
by jwkrahn (Abbot) on Apr 11, 2006 at 12:45 UTC
    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! }