in reply to number of matches

i am presuming you do not want *overlapping* matches;

ie you want simple repeat detection: if this is the case something like:
my $searchstring = 'humptydumpty'; my @matches = $searchstring =~ /umpty/g;
should work, leaving you able to access the number of matches by using scalar @matches or whatever
...wufnik

-- in the world of the mules there are no rules --