my ($nth) = $str =~ /(?:\w+\W+){3}(\w+)/; # capture 4th word [download]
In reply to Re: Re: Capturing the nth word in a string by Roger in thread Capturing the nth word in a string by Roger