in reply to Match only certain characters?
It seems to me that you are asking for something as simple as this.
my @ss = ( 'A', 'B', 'C', 'AB', 'CA', 'ABC', 'xABCx', 'BxCxAx', ); for my $s (@ss) { if ($s =~ /A/ && $s =~ /B/ && $s =~ /C/) { print "$s\n"; } }
Which outputs:
ABC xABCx BxCxAx
EDIT: This response is only to the first part of the OP's question. That is:
...if you have the strings:
$a='ABCAAAABBBCCCCCAAABBBCCC';
$b='ASRGRTGRT89579843rrrrrr';
and you wanted to pick only the string that contains A, B and C (namely $a)...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Match only certain characters?
by AnomalousMonk (Archbishop) on Nov 09, 2009 at 18:18 UTC | |
by jffry (Hermit) on Nov 09, 2009 at 22:05 UTC |