Perhaps since you're only interested in one 'word' you could save Perl the bother of capturing all of them:
print ( $str =~ /(?:\w+\W+){3}(\w+)/ ), "\n";
Of course having n (3 in this case) buried inside the regex doesn't exactly make for a general solution.
In reply to Re: Capturing the nth word in a string
by grantm
in thread Capturing the nth word in a string
by Roger
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |