Updated and added tests for regular expression escaping.