rebol lexer: unclosed character class in regex

Issue #1467 new
Thomas Waldmann
created an issue

https://bitbucket.org/birkenfeld/pygments-main/src/7941677dc77d4f2bf0bbd6140ade85a9454b8b80/pygments/lexers/rebol.py#lines-242

See how it misses the backslash before the square bracket.

Compare to the regex 3 lines above that.

re module does not like that:

>>> text='          REBOL['
>>> re.search(r'\s*REBOL\s*[', text, re.IGNORECASE)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "env/lib/python2.7/re.py", line 146, in search
    return _compile(pattern, flags).search(string)
  File "env/lib/python2.7/re.py", line 251, in _compile
    raise error, v # invalid expression
sre_constants.error: unexpected end of regular expression

Issue was found by the pycharm code checker:

"unclosed character class"

Found it in 2.1.3, but it is still there in current code.

Comments (1)

  1. Log in to comment