diff --git a/Python/Embeddings/RegExp (for Python).sublime-syntax b/Python/Embeddings/RegExp (for Python).sublime-syntax index 52d092f11d..1c03f63a97 100644 --- a/Python/Embeddings/RegExp (for Python).sublime-syntax +++ b/Python/Embeddings/RegExp (for Python).sublime-syntax @@ -56,3 +56,11 @@ contexts: 1: punctuation.definition.capture-group-name.begin.regexp 2: variable.other.backref-and-recursion.regexp 3: punctuation.definition.capture-group-name.end.regexp + + literals: + - meta_prepend: true + # no illegal parentheses in concatenated patterns + - match: \] + scope: punctuation.definition.set.end.regexp + - match: \) + scope: punctuation.section.group.end.regexp diff --git a/Python/tests/syntax_test_python_strings.py b/Python/tests/syntax_test_python_strings.py index eb378885e2..1e37c06eb9 100644 --- a/Python/tests/syntax_test_python_strings.py +++ b/Python/tests/syntax_test_python_strings.py @@ -1300,6 +1300,11 @@ # ^^^^ meta.modifier # ^ storage.modifier.mode +match = re.match(r"([^" + charset + r"]*)", line) +# ^ punctuation.section.group.begin.regexp +# ^ punctuation.definition.set.begin.regexp +# ^ punctuation.definition.set.end.regexp +# ^ punctuation.section.group.end.regexp ############################### # f-strings