Restricting the regular expression for String to only accept valid escaped characters.