Test for strings with invalid escape sequences

There are two bugs here:
* \U makes Python think this is a Unicode code point
* Other escape sequences like \p should raise