forked from microsoft/vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
302 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
299 changes: 299 additions & 0 deletions
299
extensions/python/syntaxes/Regular Expressions (Python).tmLanguage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,299 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>comment</key> | ||
<string>Matches Python's regular expression syntax.</string> | ||
<key>fileTypes</key> | ||
<array> | ||
<string>re</string> | ||
</array> | ||
<key>foldingStartMarker</key> | ||
<string>(/\*|\{|\()</string> | ||
<key>foldingStopMarker</key> | ||
<string>(\*/|\}|\))</string> | ||
<key>name</key> | ||
<string>Regular Expressions (Python)</string> | ||
<key>patterns</key> | ||
<array> | ||
<dict> | ||
<key>match</key> | ||
<string>\\[bBAZzG]|\^|\$</string> | ||
<key>name</key> | ||
<string>keyword.control.anchor.regexp</string> | ||
</dict> | ||
<dict> | ||
<key>match</key> | ||
<string>\\[1-9][0-9]?</string> | ||
<key>name</key> | ||
<string>keyword.other.back-reference.regexp</string> | ||
</dict> | ||
<dict> | ||
<key>match</key> | ||
<string>[?+*][?+]?|\{(\d+,\d+|\d+,|,\d+|\d+)\}\??</string> | ||
<key>name</key> | ||
<string>keyword.operator.quantifier.regexp</string> | ||
</dict> | ||
<dict> | ||
<key>match</key> | ||
<string>\|</string> | ||
<key>name</key> | ||
<string>keyword.operator.or.regexp</string> | ||
</dict> | ||
<dict> | ||
<key>begin</key> | ||
<string>\(\?\#</string> | ||
<key>end</key> | ||
<string>\)</string> | ||
<key>name</key> | ||
<string>comment.block.regexp</string> | ||
</dict> | ||
<dict> | ||
<key>comment</key> | ||
<string>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.</string> | ||
<key>match</key> | ||
<string>(?<=^|\s)#\s[[a-zA-Z0-9,. \t?!-:][^\x{00}-\x{7F}]]*$</string> | ||
<key>name</key> | ||
<string>comment.line.number-sign.regexp</string> | ||
</dict> | ||
<dict> | ||
<key>match</key> | ||
<string>\(\?[iLmsux]+\)</string> | ||
<key>name</key> | ||
<string>keyword.other.option-toggle.regexp</string> | ||
</dict> | ||
<dict> | ||
<key>match</key> | ||
<string>(\()(\?P=([a-zA-Z_][a-zA-Z_0-9]*\w*))(\))</string> | ||
<key>name</key> | ||
<string>keyword.other.back-reference.named.regexp</string> | ||
</dict> | ||
<dict> | ||
<key>begin</key> | ||
<string>(\()((\?=)|(\?!)|(\?<=)|(\?<!))</string> | ||
<key>beginCaptures</key> | ||
<dict> | ||
<key>1</key> | ||
<dict> | ||
<key>name</key> | ||
<string>punctuation.definition.group.regexp</string> | ||
</dict> | ||
<key>2</key> | ||
<dict> | ||
<key>name</key> | ||
<string>punctuation.definition.group.assertion.regexp</string> | ||
</dict> | ||
<key>3</key> | ||
<dict> | ||
<key>name</key> | ||
<string>meta.assertion.look-ahead.regexp</string> | ||
</dict> | ||
<key>4</key> | ||
<dict> | ||
<key>name</key> | ||
<string>meta.assertion.negative-look-ahead.regexp</string> | ||
</dict> | ||
<key>5</key> | ||
<dict> | ||
<key>name</key> | ||
<string>meta.assertion.look-behind.regexp</string> | ||
</dict> | ||
<key>6</key> | ||
<dict> | ||
<key>name</key> | ||
<string>meta.assertion.negative-look-behind.regexp</string> | ||
</dict> | ||
</dict> | ||
<key>end</key> | ||
<string>(\))</string> | ||
<key>endCaptures</key> | ||
<dict> | ||
<key>1</key> | ||
<dict> | ||
<key>name</key> | ||
<string>punctuation.definition.group.regexp</string> | ||
</dict> | ||
</dict> | ||
<key>name</key> | ||
<string>meta.group.assertion.regexp</string> | ||
<key>patterns</key> | ||
<array> | ||
<dict> | ||
<key>include</key> | ||
<string>$self</string> | ||
</dict> | ||
</array> | ||
</dict> | ||
<dict> | ||
<key>begin</key> | ||
<string>(\()(\?\(([1-9][0-9]?|[a-zA-Z_][a-zA-Z_0-9]*)\))</string> | ||
<key>beginCaptures</key> | ||
<dict> | ||
<key>1</key> | ||
<dict> | ||
<key>name</key> | ||
<string>punctuation.definition.group.regexp</string> | ||
</dict> | ||
<key>2</key> | ||
<dict> | ||
<key>name</key> | ||
<string>punctuation.definition.group.assertion.conditional.regexp</string> | ||
</dict> | ||
<key>3</key> | ||
<dict> | ||
<key>name</key> | ||
<string>entity.name.section.back-reference.regexp</string> | ||
</dict> | ||
</dict> | ||
<key>comment</key> | ||
<string>we can make this more sophisticated to match the | character that separates yes-pattern from no-pattern, but it's not really necessary.</string> | ||
<key>end</key> | ||
<string>(\))</string> | ||
<key>name</key> | ||
<string>meta.group.assertion.conditional.regexp</string> | ||
<key>patterns</key> | ||
<array> | ||
<dict> | ||
<key>include</key> | ||
<string>$self</string> | ||
</dict> | ||
</array> | ||
</dict> | ||
<dict> | ||
<key>begin</key> | ||
<string>(\()((\?P<)([a-z]\w*)(>)|(\?:))?</string> | ||
<key>beginCaptures</key> | ||
<dict> | ||
<key>1</key> | ||
<dict> | ||
<key>name</key> | ||
<string>punctuation.definition.group.regexp</string> | ||
</dict> | ||
<key>3</key> | ||
<dict> | ||
<key>name</key> | ||
<string>punctuation.definition.group.capture.regexp</string> | ||
</dict> | ||
<key>4</key> | ||
<dict> | ||
<key>name</key> | ||
<string>entity.name.section.group.regexp</string> | ||
</dict> | ||
<key>5</key> | ||
<dict> | ||
<key>name</key> | ||
<string>punctuation.definition.group.capture.regexp</string> | ||
</dict> | ||
<key>6</key> | ||
<dict> | ||
<key>name</key> | ||
<string>punctuation.definition.group.no-capture.regexp</string> | ||
</dict> | ||
</dict> | ||
<key>end</key> | ||
<string>(\))</string> | ||
<key>endCaptures</key> | ||
<dict> | ||
<key>1</key> | ||
<dict> | ||
<key>name</key> | ||
<string>punctuation.definition.group.regexp</string> | ||
</dict> | ||
</dict> | ||
<key>name</key> | ||
<string>meta.group.regexp</string> | ||
<key>patterns</key> | ||
<array> | ||
<dict> | ||
<key>include</key> | ||
<string>$self</string> | ||
</dict> | ||
</array> | ||
</dict> | ||
<dict> | ||
<key>include</key> | ||
<string>#character-class</string> | ||
</dict> | ||
</array> | ||
<key>repository</key> | ||
<dict> | ||
<key>character-class</key> | ||
<dict> | ||
<key>patterns</key> | ||
<array> | ||
<dict> | ||
<key>match</key> | ||
<string>\\[wWsSdDhH]|\.</string> | ||
<key>name</key> | ||
<string>constant.character.character-class.regexp</string> | ||
</dict> | ||
<dict> | ||
<key>match</key> | ||
<string>\\.</string> | ||
<key>name</key> | ||
<string>constant.character.escape.backslash.regexp</string> | ||
</dict> | ||
<dict> | ||
<key>begin</key> | ||
<string>(\[)(\^)?</string> | ||
<key>beginCaptures</key> | ||
<dict> | ||
<key>1</key> | ||
<dict> | ||
<key>name</key> | ||
<string>punctuation.definition.character-class.regexp</string> | ||
</dict> | ||
<key>2</key> | ||
<dict> | ||
<key>name</key> | ||
<string>keyword.operator.negation.regexp</string> | ||
</dict> | ||
</dict> | ||
<key>end</key> | ||
<string>(\])</string> | ||
<key>endCaptures</key> | ||
<dict> | ||
<key>1</key> | ||
<dict> | ||
<key>name</key> | ||
<string>punctuation.definition.character-class.regexp</string> | ||
</dict> | ||
</dict> | ||
<key>name</key> | ||
<string>constant.other.character-class.set.regexp</string> | ||
<key>patterns</key> | ||
<array> | ||
<dict> | ||
<key>include</key> | ||
<string>#character-class</string> | ||
</dict> | ||
<dict> | ||
<key>captures</key> | ||
<dict> | ||
<key>2</key> | ||
<dict> | ||
<key>name</key> | ||
<string>constant.character.escape.backslash.regexp</string> | ||
</dict> | ||
<key>4</key> | ||
<dict> | ||
<key>name</key> | ||
<string>constant.character.escape.backslash.regexp</string> | ||
</dict> | ||
</dict> | ||
<key>match</key> | ||
<string>((\\.)|.)\-((\\.)|[^\]])</string> | ||
<key>name</key> | ||
<string>constant.other.character-class.range.regexp</string> | ||
</dict> | ||
</array> | ||
</dict> | ||
</array> | ||
</dict> | ||
</dict> | ||
<key>scopeName</key> | ||
<string>source.regexp.python</string> | ||
<key>uuid</key> | ||
<string>DD867ABF-1EC6-415D-B047-687F550A1D51</string> | ||
</dict> | ||
</plist> |