my ($nth) = $str =~ /(?:\w+\W+){3}(\w+)/; # capture 4th word