in reply to Benchmarking "Are all these characters in this sentence?"
sub lookahead { my ($sentence, $wantedLetters) = @_; $wantedLetters =~ s/(.)/(?=.*?\Q$1\E)/sg; $sentence =~ /^$wantedLetters/s; } [download]