prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  E0000 found unknown escape character ‘/’
  version:1:1
  
  cfn-lint --template vpc.cf.json
  E0000 found unknown escape character ‘/’
  vpc.cf.json:12:135
  
  this is the string that it says container the escape character error. this however works fine when deployed to the CFN service. 
  
  "^([0-9]{1,3}\\.){3}[0-9]{1,3}(\\\/([0-9]|[1-2][0-9]|3[0-2]))?$"
  
  ![image](https://user-images.githubusercontent.com/42137702/54364854-a11a3000-4665-11e9-8454-9ab8033fc1e7.png)
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `src/cfnlint/decode/__init__.py`
  Content:
  ```
  1 """
  2   Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  3 
  4   Permission is hereby granted, free of charge, to any person obtaining a copy of this
  5   software and associated documentation files (the "Software"), to deal in the Software
  6   without restriction, including without limitation the rights to use, copy, modify,
  7   merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
  8   permit persons to whom the Software is furnished to do so.
  9 
  10   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
  11   INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  12   PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  13   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  14   OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  15   SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  16 """
  17 import sys
  18 import logging
  19 import six
  20 try:
  21     from json.decoder import JSONDecodeError
  22 except ImportError:
  23     JSONDecodeError = ValueError
  24 from yaml.parser import ParserError, ScannerError
  25 from yaml import YAMLError
  26 import cfnlint.decode.cfn_yaml
  27 import cfnlint.decode.cfn_json
  28 
  29 
  30 LOGGER = logging.getLogger(__name__)
  31 
  32 
  33 def decode(filename, ignore_bad_template):
  34     """
  35         Decode filename into an object
  36     """
  37     template = None
  38     matches = []
  39     try:
  40         template = cfnlint.decode.cfn_yaml.load(filename)
  41     except IOError as e:
  42         if e.errno == 2:
  43             LOGGER.error('Template file not found: %s', filename)
  44             matches.append(create_match_file_error(filename, 'Template file not found: %s' % filename))
  45         elif e.errno == 21:
  46             LOGGER.error('Template references a directory, not a file: %s', filename)
  47             matches.append(create_match_file_error(filename, 'Template references a directory, not a file: %s' % filename))
  48         elif e.errno == 13:
  49             LOGGER.error('Permission denied when accessing template file: %s', filename)
  50             matches.append(create_match_file_error(filename, 'Permission denied when accessing template file: %s' % filename))
  51 
  52         if matches:
  53             return(None, matches)
  54     except UnicodeDecodeError as err:
  55         LOGGER.error('Cannot read file contents: %s', filename)
  56         matches.append(create_match_file_error(filename, 'Cannot read file contents: %s' % filename))
  57     except cfnlint.decode.cfn_yaml.CfnParseError as err:
  58         err.match.Filename = filename
  59         matches = [err.match]
  60 
  61     except ParserError as err:
  62         matches = [create_match_yaml_parser_error(err, filename)]
  63     except ScannerError as err:
  64         if err.problem == 'found character \'\\t\' that cannot start any token':
  65             try:
  66                 template = cfnlint.decode.cfn_json.load(filename)
  67             except cfnlint.decode.cfn_json.JSONDecodeError as json_err:
  68                 json_err.match.filename = filename
  69                 matches = [json_err.match]
  70             except JSONDecodeError as json_err:
  71                 matches = [create_match_json_parser_error(json_err, filename)]
  72             except Exception as json_err:  # pylint: disable=W0703
  73                 if ignore_bad_template:
  74                     LOGGER.info('Template %s is malformed: %s', filename, err.problem)
  75                     LOGGER.info('Tried to parse %s as JSON but got error: %s', filename, str(json_err))
  76                 else:
  77                     LOGGER.error('Template %s is malformed: %s', filename, err.problem)
  78                     LOGGER.error('Tried to parse %s as JSON but got error: %s', filename, str(json_err))
  79                     return(None, [create_match_file_error(filename, 'Tried to parse %s as JSON but got error: %s' % (filename, str(json_err)))])
  80         else:
  81             matches = [create_match_yaml_parser_error(err, filename)]
  82     except YAMLError as err:
  83         matches = [create_match_file_error(filename, err)]
  84 
  85     if not isinstance(template, dict) and not matches:
  86         # Template isn't a dict which means nearly nothing will work
  87         matches = [cfnlint.Match(1, 1, 1, 1, filename, cfnlint.ParseError(), message='Template needs to be an object.')]
  88     return (template, matches)
  89 
  90 
  91 def create_match_yaml_parser_error(parser_error, filename):
  92     """Create a Match for a parser error"""
  93     lineno = parser_error.problem_mark.line + 1
  94     colno = parser_error.problem_mark.column + 1
  95     msg = parser_error.problem
  96     return cfnlint.Match(
  97         lineno, colno, lineno, colno + 1, filename,
  98         cfnlint.ParseError(), message=msg)
  99 
  100 
  101 def create_match_file_error(filename, msg):
  102     """Create a Match for a parser error"""
  103     return cfnlint.Match(
  104         linenumber=1, columnnumber=1, linenumberend=1, columnnumberend=2,
  105         filename=filename, rule=cfnlint.ParseError(), message=msg)
  106 
  107 
  108 def create_match_json_parser_error(parser_error, filename):
  109     """Create a Match for a parser error"""
  110     if sys.version_info[0] == 3:
  111         lineno = parser_error.lineno
  112         colno = parser_error.colno
  113         msg = parser_error.msg
  114     elif sys.version_info[0] == 2:
  115         lineno = 1
  116         colno = 1
  117         msg = parser_error.message
  118     return cfnlint.Match(
  119         lineno, colno, lineno, colno + 1, filename, cfnlint.ParseError(), message=msg)
  120
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/src/cfnlint/decode/__init__.py b/src/cfnlint/decode/__init__.py
  --- a/src/cfnlint/decode/__init__.py
  +++ b/src/cfnlint/decode/__init__.py
  @@ -57,11 +57,12 @@
       except cfnlint.decode.cfn_yaml.CfnParseError as err:
           err.match.Filename = filename
           matches = [err.match]
  -
       except ParserError as err:
           matches = [create_match_yaml_parser_error(err, filename)]
       except ScannerError as err:
  -        if err.problem == 'found character \'\\t\' that cannot start any token':
  +        if err.problem in [
  +                'found character \'\\t\' that cannot start any token',
  +                'found unknown escape character']:
               try:
                   template = cfnlint.decode.cfn_json.load(filename)
               except cfnlint.decode.cfn_json.JSONDecodeError as json_err:
  
verification_info: {"golden_diff": "diff --git a/src/cfnlint/decode/__init__.py b/src/cfnlint/decode/__init__.py\n--- a/src/cfnlint/decode/__init__.py\n+++ b/src/cfnlint/decode/__init__.py\n@@ -57,11 +57,12 @@\n     except cfnlint.decode.cfn_yaml.CfnParseError as err:\n         err.match.Filename = filename\n         matches = [err.match]\n-\n     except ParserError as err:\n         matches = [create_match_yaml_parser_error(err, filename)]\n     except ScannerError as err:\n-        if err.problem == 'found character \\'\\\\t\\' that cannot start any token':\n+        if err.problem in [\n+                'found character \\'\\\\t\\' that cannot start any token',\n+                'found unknown escape character']:\n             try:\n                 template = cfnlint.decode.cfn_json.load(filename)\n             except cfnlint.decode.cfn_json.JSONDecodeError as json_err:\n", "issue": "E0000 found unknown escape character \u2018/\u2019\nversion:1:1\r\n\r\ncfn-lint --template vpc.cf.json\r\nE0000 found unknown escape character \u2018/\u2019\r\nvpc.cf.json:12:135\r\n\r\nthis is the string that it says container the escape character error. this however works fine when deployed to the CFN service. \r\n\r\n\"^([0-9]{1,3}\\\\.){3}[0-9]{1,3}(\\\\\\/([0-9]|[1-2][0-9]|3[0-2]))?$\"\r\n\r\n![image](https://user-images.githubusercontent.com/42137702/54364854-a11a3000-4665-11e9-8454-9ab8033fc1e7.png)\r\n\n", "before_files": [{"content": "\"\"\"\n  Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n\n  Permission is hereby granted, free of charge, to any person obtaining a copy of this\n  software and associated documentation files (the \"Software\"), to deal in the Software\n  without restriction, including without limitation the rights to use, copy, modify,\n  merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\n  permit persons to whom the Software is furnished to do so.\n\n  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n  INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n  PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\"\"\"\nimport sys\nimport logging\nimport six\ntry:\n    from json.decoder import JSONDecodeError\nexcept ImportError:\n    JSONDecodeError = ValueError\nfrom yaml.parser import ParserError, ScannerError\nfrom yaml import YAMLError\nimport cfnlint.decode.cfn_yaml\nimport cfnlint.decode.cfn_json\n\n\nLOGGER = logging.getLogger(__name__)\n\n\ndef decode(filename, ignore_bad_template):\n    \"\"\"\n        Decode filename into an object\n    \"\"\"\n    template = None\n    matches = []\n    try:\n        template = cfnlint.decode.cfn_yaml.load(filename)\n    except IOError as e:\n        if e.errno == 2:\n            LOGGER.error('Template file not found: %s', filename)\n            matches.append(create_match_file_error(filename, 'Template file not found: %s' % filename))\n        elif e.errno == 21:\n            LOGGER.error('Template references a directory, not a file: %s', filename)\n            matches.append(create_match_file_error(filename, 'Template references a directory, not a file: %s' % filename))\n        elif e.errno == 13:\n            LOGGER.error('Permission denied when accessing template file: %s', filename)\n            matches.append(create_match_file_error(filename, 'Permission denied when accessing template file: %s' % filename))\n\n        if matches:\n            return(None, matches)\n    except UnicodeDecodeError as err:\n        LOGGER.error('Cannot read file contents: %s', filename)\n        matches.append(create_match_file_error(filename, 'Cannot read file contents: %s' % filename))\n    except cfnlint.decode.cfn_yaml.CfnParseError as err:\n        err.match.Filename = filename\n        matches = [err.match]\n\n    except ParserError as err:\n        matches = [create_match_yaml_parser_error(err, filename)]\n    except ScannerError as err:\n        if err.problem == 'found character \\'\\\\t\\' that cannot start any token':\n            try:\n                template = cfnlint.decode.cfn_json.load(filename)\n            except cfnlint.decode.cfn_json.JSONDecodeError as json_err:\n                json_err.match.filename = filename\n                matches = [json_err.match]\n            except JSONDecodeError as json_err:\n                matches = [create_match_json_parser_error(json_err, filename)]\n            except Exception as json_err:  # pylint: disable=W0703\n                if ignore_bad_template:\n                    LOGGER.info('Template %s is malformed: %s', filename, err.problem)\n                    LOGGER.info('Tried to parse %s as JSON but got error: %s', filename, str(json_err))\n                else:\n                    LOGGER.error('Template %s is malformed: %s', filename, err.problem)\n                    LOGGER.error('Tried to parse %s as JSON but got error: %s', filename, str(json_err))\n                    return(None, [create_match_file_error(filename, 'Tried to parse %s as JSON but got error: %s' % (filename, str(json_err)))])\n        else:\n            matches = [create_match_yaml_parser_error(err, filename)]\n    except YAMLError as err:\n        matches = [create_match_file_error(filename, err)]\n\n    if not isinstance(template, dict) and not matches:\n        # Template isn't a dict which means nearly nothing will work\n        matches = [cfnlint.Match(1, 1, 1, 1, filename, cfnlint.ParseError(), message='Template needs to be an object.')]\n    return (template, matches)\n\n\ndef create_match_yaml_parser_error(parser_error, filename):\n    \"\"\"Create a Match for a parser error\"\"\"\n    lineno = parser_error.problem_mark.line + 1\n    colno = parser_error.problem_mark.column + 1\n    msg = parser_error.problem\n    return cfnlint.Match(\n        lineno, colno, lineno, colno + 1, filename,\n        cfnlint.ParseError(), message=msg)\n\n\ndef create_match_file_error(filename, msg):\n    \"\"\"Create a Match for a parser error\"\"\"\n    return cfnlint.Match(\n        linenumber=1, columnnumber=1, linenumberend=1, columnnumberend=2,\n        filename=filename, rule=cfnlint.ParseError(), message=msg)\n\n\ndef create_match_json_parser_error(parser_error, filename):\n    \"\"\"Create a Match for a parser error\"\"\"\n    if sys.version_info[0] == 3:\n        lineno = parser_error.lineno\n        colno = parser_error.colno\n        msg = parser_error.msg\n    elif sys.version_info[0] == 2:\n        lineno = 1\n        colno = 1\n        msg = parser_error.message\n    return cfnlint.Match(\n        lineno, colno, lineno, colno + 1, filename, cfnlint.ParseError(), message=msg)\n", "path": "src/cfnlint/decode/__init__.py"}], "after_files": [{"content": "\"\"\"\n  Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n\n  Permission is hereby granted, free of charge, to any person obtaining a copy of this\n  software and associated documentation files (the \"Software\"), to deal in the Software\n  without restriction, including without limitation the rights to use, copy, modify,\n  merge, publish, distribute, sublicense, and/or sell copies of the Software, and to\n  permit persons to whom the Software is furnished to do so.\n\n  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n  INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A\n  PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\"\"\"\nimport sys\nimport logging\nimport six\ntry:\n    from json.decoder import JSONDecodeError\nexcept ImportError:\n    JSONDecodeError = ValueError\nfrom yaml.parser import ParserError, ScannerError\nfrom yaml import YAMLError\nimport cfnlint.decode.cfn_yaml\nimport cfnlint.decode.cfn_json\n\n\nLOGGER = logging.getLogger(__name__)\n\n\ndef decode(filename, ignore_bad_template):\n    \"\"\"\n        Decode filename into an object\n    \"\"\"\n    template = None\n    matches = []\n    try:\n        template = cfnlint.decode.cfn_yaml.load(filename)\n    except IOError as e:\n        if e.errno == 2:\n            LOGGER.error('Template file not found: %s', filename)\n            matches.append(create_match_file_error(filename, 'Template file not found: %s' % filename))\n        elif e.errno == 21:\n            LOGGER.error('Template references a directory, not a file: %s', filename)\n            matches.append(create_match_file_error(filename, 'Template references a directory, not a file: %s' % filename))\n        elif e.errno == 13:\n            LOGGER.error('Permission denied when accessing template file: %s', filename)\n            matches.append(create_match_file_error(filename, 'Permission denied when accessing template file: %s' % filename))\n\n        if matches:\n            return(None, matches)\n    except UnicodeDecodeError as err:\n        LOGGER.error('Cannot read file contents: %s', filename)\n        matches.append(create_match_file_error(filename, 'Cannot read file contents: %s' % filename))\n    except cfnlint.decode.cfn_yaml.CfnParseError as err:\n        err.match.Filename = filename\n        matches = [err.match]\n    except ParserError as err:\n        matches = [create_match_yaml_parser_error(err, filename)]\n    except ScannerError as err:\n        if err.problem in [\n                'found character \\'\\\\t\\' that cannot start any token',\n                'found unknown escape character']:\n            try:\n                template = cfnlint.decode.cfn_json.load(filename)\n            except cfnlint.decode.cfn_json.JSONDecodeError as json_err:\n                json_err.match.filename = filename\n                matches = [json_err.match]\n            except JSONDecodeError as json_err:\n                matches = [create_match_json_parser_error(json_err, filename)]\n            except Exception as json_err:  # pylint: disable=W0703\n                if ignore_bad_template:\n                    LOGGER.info('Template %s is malformed: %s', filename, err.problem)\n                    LOGGER.info('Tried to parse %s as JSON but got error: %s', filename, str(json_err))\n                else:\n                    LOGGER.error('Template %s is malformed: %s', filename, err.problem)\n                    LOGGER.error('Tried to parse %s as JSON but got error: %s', filename, str(json_err))\n                    return(None, [create_match_file_error(filename, 'Tried to parse %s as JSON but got error: %s' % (filename, str(json_err)))])\n        else:\n            matches = [create_match_yaml_parser_error(err, filename)]\n    except YAMLError as err:\n        matches = [create_match_file_error(filename, err)]\n\n    if not isinstance(template, dict) and not matches:\n        # Template isn't a dict which means nearly nothing will work\n        matches = [cfnlint.Match(1, 1, 1, 1, filename, cfnlint.ParseError(), message='Template needs to be an object.')]\n    return (template, matches)\n\n\ndef create_match_yaml_parser_error(parser_error, filename):\n    \"\"\"Create a Match for a parser error\"\"\"\n    lineno = parser_error.problem_mark.line + 1\n    colno = parser_error.problem_mark.column + 1\n    msg = parser_error.problem\n    return cfnlint.Match(\n        lineno, colno, lineno, colno + 1, filename,\n        cfnlint.ParseError(), message=msg)\n\n\ndef create_match_file_error(filename, msg):\n    \"\"\"Create a Match for a parser error\"\"\"\n    return cfnlint.Match(\n        linenumber=1, columnnumber=1, linenumberend=1, columnnumberend=2,\n        filename=filename, rule=cfnlint.ParseError(), message=msg)\n\n\ndef create_match_json_parser_error(parser_error, filename):\n    \"\"\"Create a Match for a parser error\"\"\"\n    if sys.version_info[0] == 3:\n        lineno = parser_error.lineno\n        colno = parser_error.colno\n        msg = parser_error.msg\n    elif sys.version_info[0] == 2:\n        lineno = 1\n        colno = 1\n        msg = parser_error.message\n    return cfnlint.Match(\n        lineno, colno, lineno, colno + 1, filename, cfnlint.ParseError(), message=msg)\n", "path": "src/cfnlint/decode/__init__.py"}]}