in reply to Match only certain characters?
Note that I didn't use $a or $b as those should be reserved for the sort function.#!/usr/bin/perl use strict; use warnings; my $s='ABCAAAABBBCCCCCAAABBBCCC'; if (0 == $s =~ tr/ABC//c) { print "All letters are A B or C"; }
Chris
|
|---|