http://www.perlmonks.org?node_id=20072


in reply to How do I find the Nth occurrence of a pattern?

you could use =~ in array context like:
$string = "12 34 56 78 90 98 76 54 32 10"; (@matches) = ($string =~ /(\d+)/g); print "fifth match is $matches[4]\n"; print "eigth match is $matches[7]\n";

/\/\averick