Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 7 years ago

Language

Python

Compiler

CPython HEAD 3.8.0a0

Options

Author

anonymous

over 7 years ago

$ python3 prog.py
Traceback (most recent call last):
  File "/opt/wandbox/cpython-head/lib/python3.8/sre_parse.py", line 1045, in parse_template
    this = chr(ESCAPES[this][1])
KeyError: '\\s'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "prog.py", line 11, in <module>
    preprocess_regex('*')
  File "prog.py", line 5, in preprocess_regex
    regex = re.sub(r"\\s\*\(\?P<([^>]+)>\.\+\)", r"\s*(?P<\1>\S.*)", regex)
  File "/opt/wandbox/cpython-head/lib/python3.8/re.py", line 192, in sub
    return _compile(pattern, flags).sub(repl, string, count)
  File "/opt/wandbox/cpython-head/lib/python3.8/re.py", line 309, in _subx
    template = _compile_repl(template, pattern)
  File "/opt/wandbox/cpython-head/lib/python3.8/re.py", line 300, in _compile_repl
    return sre_parse.parse_template(repl, pattern)
  File "/opt/wandbox/cpython-head/lib/python3.8/sre_parse.py", line 1048, in parse_template
    raise s.error('bad escape %s' % this, len(this))
re.error: bad escape \s at position 0
Exit Code:
1