my $n = whatever... my $i=0; while ( ($string =~ /PATTERN/g) && ($i < $n ) ) { $i++; } my $NthMatch = $1;
In reply to Re: How do I find the Nth occurrence of a pattern?
by cLive ;-)
in thread How do I find the Nth occurrence of a pattern?
by vroom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |