in reply to match the nth pattern

There's no special syntax or functionality to do this. So you have to do it yourself. And it depends whether you want the nth non-overlapping, or the nth overlapping match. For instance, the line "hahahaha" has 2 non-overlapping matches of "haha", but three overlapping. For non overlapping, this may work for you:
($str =~ /hai/g)[3]; # Fourth match
For overlapping, try:
($str =~ /(?=(hai))/g)[3]; # Fourth match