in reply to Re: Match only certain characters?
in thread Match only certain characters?

But the OP asked for...
... a way to search only for the string that has the letters A,B,C and no other letter ...
which clearly excludes a string like 'xABCx'.

Replies are listed 'Best First'.
Re^3: Match only certain characters?
by jffry (Hermit) on Nov 09, 2009 at 22:05 UTC

    In that case, I'd have to do this, then.

    my @ss = qw( A B C AB CA ABC xABCx BxCxAx ); for (@ss) { if (/A/ && /B/ && /C/ && !/[^ABC]/) { print "$_\n"; } }