Throwing exception when strings contain invalid escape sequences.