$string =~ /$word\s*?(\S+)/g; my $next_word = $1; $string =~ /\G\s*?(\S+)/g; my $next_word_2 = $1;