$str = '...+...'; $str =~ /(.)[^\1]/; # And now I had in mind to have $& containing '.+'