Skip to content

Commit a64d312

Browse files
author
MattDMo
committed
Character properties to classes
1 parent 729361b commit a64d312

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Regular Expressions (PythonImproved).YAML-tmLanguage

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ patterns:
2727
- comment: We are restrictive in what we allow to go after the comment character to
2828
avoid false positives, since the availability of comments depend on regexp flags.
2929
name: comment.line.number-sign.regexp
30-
match: (?<=^|\s)#\s[[\p{Alnum},. \t?!-:][^\x{00}-\x{7F}]]*$
30+
match: (?<=^|\s)#\s[[[:alnum:],. \t?!-:][^\x{00}-\x{7F}]]*$
3131

3232
- name: keyword.other.option-toggle.regexp
33-
match: \(\?[iLmsux]+\)
33+
match: \(\?[giLmsux]+\)
3434

3535
- name: keyword.other.back-reference.named.regexp
36-
match: (\()(\?P=([\p{Alpha}_][\p{Alnum}_]*\w*))(\))
36+
match: (\()(\?P=([[:alpha:]_][[:alnum:]_]*\w*))(\))
3737

3838
- name: meta.group.assertion.regexp
3939
begin: (\()((\?=)|(\?!)|(\?<=)|(\?<!))
@@ -53,7 +53,7 @@ patterns:
5353
- comment: we can make this more sophisticated to match the | character that separates
5454
yes-pattern from no-pattern, but it's not really necessary.
5555
name: meta.group.assertion.conditional.regexp
56-
begin: (\()(\?\(([1-9][0-9]?|[\p{Alpha}_][\p{Alnum}_]*)\))
56+
begin: (\()(\?\(([1-9][0-9]?|[[:alpha:]_][[:alnum:]_]*)\))
5757
beginCaptures:
5858
'1': {name: punctuation.definition.group.regexp}
5959
'2': {name: punctuation.definition.group.assertion.conditional.regexp}
@@ -63,7 +63,7 @@ patterns:
6363
- include: $self
6464

6565
- name: meta.group.regexp
66-
begin: (\()((\?P<)([\p{Alpha}]\w*)(>)|(\?:))?
66+
begin: (\()((\?P<)([[:alpha:]_][[:alnum:]_]*)(>)|(\?:))?
6767
beginCaptures:
6868
'1': {name: punctuation.definition.group.regexp}
6969
'3': {name: punctuation.definition.group.capture.regexp}

0 commit comments

Comments
 (0)