in reply to How do I find the Nth occurrence of a pattern?
my $n = whatever... my $i=0; while ( ($string =~ /PATTERN/g) && ($i < $n ) ) { $i++; } my $NthMatch = $1; [download]
/(PATTERN)/g [download]