my $string = "zero one two three"; my $offset = 1; print $string =~ /(?:[^\s]+\s+){$offset}([^\s]+)/; __END__ one