{ "name": "Regular Expressions (Python)", "scopeName": "source.regexp.python", "foldingStartMarker": "(/\\*|\\{|\\()", "foldingStopMarker": "(\\*/|\\}|\\))", "fileTypes": [ "re" ], "patterns": [ { "match": "\\\\[bBAZzG]|\\^|\\$", "name": "keyword.control.anchor.regexp" }, { "match": "\\\\[1-9][0-9]?", "name": "keyword.other.back-reference.regexp" }, { "match": "\\\\.", "name": "constant.character.escape.backslash.regexp" }, { "match": "[?+*][?+]?|\\{(\\d+,\\d+|\\d+,|,\\d+|\\d+)\\}\\??", "name": "keyword.operator.quantifier.regexp" }, { "match": "\\|", "name": "keyword.operator.or.regexp" }, { "begin": "\\(\\?\\#", "end": "\\)", "name": "comment.block.regexp" }, { "comment": "We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags.", "match": "(?<=^|\\s)#\\s[[a-zA-Z0-9,. \\t?!-:][^\\x{00}-\\x{7F}]]*$", "name": "comment.line.number-sign.regexp" }, { "match": "\\(\\?[iLmsux]+\\)", "name": "keyword.other.option-toggle.regexp" }, { "match": "(\\()(\\?P=([a-zA-Z_][a-zA-Z_0-9]*\\w*))(\\))", "name": "keyword.other.back-reference.named.regexp" }, { "begin": "(\\()((\\?=)|(\\?!)|(\\?<=)|(\\?)|(\\?:))?", "beginCaptures": { "1": { "name": "punctuation.definition.group.regexp" }, "3": { "name": "punctuation.definition.group.capture.regexp" }, "4": { "name": "entity.name.section.group.regexp" }, "5": { "name": "punctuation.definition.group.capture.regexp" }, "6": { "name": "punctuation.definition.group.no-capture.regexp" } }, "end": "(\\))", "endCaptures": { "1": { "name": "punctuation.definition.group.regexp" } }, "name": "meta.group.regexp", "patterns": [ { "include": "$self" } ] }, { "begin": "(\\[)(\\^)?", "beginCaptures": { "1": { "name": "punctuation.definition.character-class.begin.regexp" }, "2": { "name": "keyword.operator.negation.regexp" } }, "end": "(?!\\G)\\]", "endCaptures": { "0": { "name": "punctuation.definition.character-class.end.regexp" } }, "name": "constant.other.character-class.set.regexp", "patterns": [ { "match": "\\\\[wWsSdDhH]", "name": "constant.character.character-class.regexp" }, { "match": "\\\\.", "name": "constant.character.escape.backslash.regexp" }, { "captures": { "2": { "name": "constant.character.escape.backslash.regexp" }, "4": { "name": "constant.character.escape.backslash.regexp" } }, "match": "((\\\\.)|.)\\-((\\\\.)|[^\\]])", "name": "constant.other.character-class.range.regexp" } ] } ] }