in reply to Matching character

You can use substr:
$string = 'abcd\\'; print "Matched\n" if '\\' eq substr $string, -1;
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ