my @foo = split /01/"00001111"; $foo[0]=~s/0/1/; if ($foo[0] eq $foo[1]) {print "String is OK\n";}