http://qs1969.pair.com?node_id=1150236


in reply to Re: Tri state string compare?
in thread Tri state string compare? (Solved! see update2)

Just a variant that takes the rules of the original question a little more literally and strictly ...

use strict; use warnings; my $abc = "AABCBAABCCCCAB"; my $ab = "AABABAABABABAB"; $abc =~ s/C/[AB]/g; $abc = qr/^$abc$/; print "They match!\n" if $ab =~ $abc;
Ron