in reply to check if all certain chars are found in a sentence
my $map = 'abc'; my $re = '^' . join '', map "(?=.*?$_)", map quotemeta, split m//, $ma +p; if ('text without all three chars' =~ m/$re/) { print "Failure"; }
While you might call it elegant, it's probably not the most efficient way for long strings.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: check if all certain chars are found in a sentence
by ikegami (Patriarch) on Aug 27, 2008 at 17:56 UTC |