in reply to Benchmarking "Are all these characters in this sentence?"
Just for completeness, try this one, too:
Putting the whole sentence into a character class will kind of suck with veeery long sentences but medium-sized cases should benefit from the one-pass approach.martin => sub { # args: sentence, wantedchars '' eq $_[1] || '' ne $_[0] && $_[1] =~ /^[\Q$_[0]\E]*\z/; },
Update: fixed the order of subroutine parameters
In Section
Meditations