in reply to how to match after the n-th occurance?

You can do a global match for a single instance and index the result: my $foo = ($text =~ m!<TD nowrap>([^<]*)</TD>!g)[12]; Indexing places the global match in list context.

After Compline,
Zaxo