|
120 | 120 | # ^ variable.other.backref-and-recursion.regexp |
121 | 121 | # ^ - keyword |
122 | 122 |
|
| 123 | +regex = r'(?P<quote>[\'"]).*?(?"e)' # `?&` is for the regex package |
| 124 | +# ^^^^^^^^^ keyword.other.backref-and-recursion.regexp - keyword keyword |
| 125 | +# ^ punctuation.definition.capture-group-name.begin.regexp |
| 126 | +# ^^^^^ entity.name.capture-group.regexp - invalid |
| 127 | +# ^ punctuation.definition.capture-group-name.end.regexp |
| 128 | +# ^^^^^^^ keyword.other.backref-and-recursion.regexp |
| 129 | +# ^^^^^ variable.other.capture-group.regexp |
| 130 | +# ^ - keyword - variable |
| 131 | + |
123 | 132 | regex = r'(?P<quote>[\'"]).*?(?P=quote)' |
124 | | -# ^^ keyword.other.backref-and-recursion.regexp |
| 133 | +# ^^^^^^^^^ keyword.other.backref-and-recursion.regexp - keyword keyword |
125 | 134 | # ^ punctuation.definition.capture-group-name.begin.regexp |
126 | 135 | # ^^^^^ entity.name.capture-group.regexp - invalid |
127 | 136 | # ^ punctuation.definition.capture-group-name.end.regexp |
128 | | -# ^^^ keyword.other.back-reference.named.regexp |
129 | | -# ^^^^^ variable.other.backref-and-recursion.regexp - invalid |
| 137 | +# ^^^^^^^^ keyword.other.backref-and-recursion.regexp - keyword keyword |
| 138 | +# ^^^^^ variable.other.capture-group.regexp - invalid |
| 139 | +# ^ - keyword - variable |
130 | 140 |
|
131 | 141 | regex = r'(?P<Quote>[\'"]).*?(?P=Quote)' |
132 | | -# ^^ keyword.other.backref-and-recursion.regexp |
| 142 | +# ^^^^^^^^^ keyword.other.backref-and-recursion.regexp - keyword keyword |
133 | 143 | # ^ punctuation.definition.capture-group-name.begin.regexp |
134 | 144 | # ^^^^^ entity.name.capture-group.regexp - invalid |
135 | 145 | # ^ punctuation.definition.capture-group-name.end.regexp |
136 | | -# ^^^ keyword.other.back-reference.named.regexp |
137 | | -# ^^^^^ variable.other.backref-and-recursion.regexp - invalid |
| 146 | +# ^^^^^^^^ keyword.other.backref-and-recursion.regexp - keyword keyword |
| 147 | +# ^^^^^ variable.other.capture-group.regexp - invalid |
| 148 | +# ^ - keyword - variable |
138 | 149 |
|
139 | 150 | regex = r'(?P<quote>[\'"]).*?\g<quote>' |
140 | | -# ^^ keyword.other.backref-and-recursion.regexp |
| 151 | +# ^^^^^^^^^ keyword.other.backref-and-recursion.regexp - keyword keyword |
141 | 152 | # ^ punctuation.definition.capture-group-name.begin.regexp |
142 | 153 | # ^^^^^ entity.name.capture-group.regexp - invalid |
143 | 154 | # ^ punctuation.definition.capture-group-name.end.regexp |
144 | | -# ^^ keyword.other.backref-and-recursion.regexp |
145 | | -# ^^^^^ variable.other.backref-and-recursion.regexp - invalid |
| 155 | +# ^^^^^^^^^ keyword.other.backref-and-recursion.regexp - keyword keyword |
| 156 | +# ^^^^^ variable.other.capture-group.regexp - invalid |
146 | 157 |
|
147 | 158 | regex = r'(?P<Quote>[\'"]).*?\g<Quote>' |
148 | | -# ^^ keyword.other.backref-and-recursion.regexp |
| 159 | +# ^^^^^^^^^ keyword.other.backref-and-recursion.regexp - keyword keyword |
149 | 160 | # ^ punctuation.definition.capture-group-name.begin.regexp |
150 | 161 | # ^^^^^ entity.name.capture-group.regexp - invalid |
151 | 162 | # ^ punctuation.definition.capture-group-name.end.regexp |
152 | | -# ^^ keyword.other.backref-and-recursion.regexp |
153 | | -# ^^^^^ variable.other.backref-and-recursion.regexp - invalid |
| 163 | +# ^^^^^^^^^ keyword.other.backref-and-recursion.regexp - keyword keyword |
| 164 | +# ^^^^^ variable.other.capture-group.regexp - invalid |
154 | 165 |
|
155 | 166 | regex = r'''\b ([fobar]*){1}(?:a|b)?''' |
156 | 167 | # ^^^^^^^^^^^^^^^^^^^^^^^^ meta.mode.extended.regexp |
|
1263 | 1274 | # ^^ constant.character.escape.regexp constant.character.escape.python |
1264 | 1275 |
|
1265 | 1276 | match = re.match(r'(?P<test>a)?b(?(test)c|d)', line) |
1266 | | -# ^^^^^^^^^^ meta.group.regexp |
| 1277 | +# ^^^^^^^^^^^ meta.group.regexp |
1267 | 1278 | # ^ punctuation.section.group.begin |
1268 | | -# ^^ keyword.other.backref-and-recursion |
| 1279 | +# ^^^^^^^^ keyword.other.backref-and-recursion.regexp - keyword keyword |
1269 | 1280 | # ^ punctuation.definition.capture-group-name.begin |
1270 | 1281 | # ^^^^ entity.name.capture-group |
1271 | 1282 | # ^ punctuation.definition.capture-group-name.end |
1272 | 1283 | # ^ punctuation.section.group.end |
1273 | 1284 | # ^ keyword.operator.quantifier |
1274 | 1285 | # ^ punctuation.section.group.begin |
1275 | | -# ^ keyword.other.backref-and-recursion.conditional |
1276 | | -# ^ punctuation.definition.group.begin.assertion.conditional |
1277 | | -# ^^^^ variable.other.back-reference |
1278 | | -# ^ punctuation.definition.group.end.assertion.conditional |
| 1286 | +# ^^^^^^^ keyword.other.backref-and-recursion.regexp - keyword keyword |
| 1287 | +# ^ punctuation.definition.capture-group-name.begin.regexp |
| 1288 | +# ^^^^ variable.other.capture-group.regexp |
| 1289 | +# ^ punctuation.definition.capture-group-name.end.regexp |
1279 | 1290 | # ^ keyword.operator.alternation |
1280 | 1291 | # ^ punctuation.section.group.end |
1281 | 1292 | match = re.match(r'(a)?b(?(1)c|d)', line) |
|
1284 | 1295 | # ^ punctuation.section.group.end |
1285 | 1296 | # ^ keyword.operator.quantifier |
1286 | 1297 | # ^ punctuation.section.group.begin |
1287 | | -# ^ keyword.other.backref-and-recursion.conditional |
1288 | | -# ^ punctuation.definition.group.begin.assertion.conditional |
1289 | | -# ^ variable.other.back-reference - punctuation - keyword |
1290 | | -# ^ punctuation.definition.group.end.assertion.conditional |
| 1298 | +# ^^^^ keyword.other.backref-and-recursion.regexp - keyword keyword |
| 1299 | +# ^ punctuation.definition.capture-group-name.begin.regexp |
| 1300 | +# ^ variable.other.capture-group.regexp |
| 1301 | +# ^ punctuation.definition.capture-group-name.end.regexp |
1291 | 1302 | # ^ keyword.operator.alternation |
1292 | 1303 | # ^ punctuation.section.group.end |
1293 | 1304 | match = re.search(r'''(?P<quote>['"]).*?(?P=quote)''', line) |
1294 | 1305 | # ^^^^^^^^^^^^^^^ meta.group.regexp |
1295 | 1306 | # ^ punctuation.section.group.begin |
1296 | | -# ^^ keyword.other.backref-and-recursion |
| 1307 | +# ^^^^^^^^^ keyword.other.backref-and-recursion.regexp - keyword keyword |
1297 | 1308 | # ^ punctuation.definition.capture-group-name.begin |
1298 | 1309 | # ^^^^^ entity.name.capture-group |
1299 | 1310 | # ^ punctuation.definition.capture-group-name.end |
|
1303 | 1314 | # ^ punctuation.section.group.end |
1304 | 1315 | # ^ keyword.other.any - meta.group |
1305 | 1316 | # ^^ keyword.operator.quantifier |
1306 | | -# ^^^ keyword.other.back-reference.named |
1307 | | -# ^^^^^ variable.other.backref-and-recursion - keyword |
| 1317 | +# ^^^ keyword.other.backref-and-recursion.regexp - keyword keyword - variable |
| 1318 | +# ^^^^^ keyword.other.backref-and-recursion.regexp variable.other.capture-group.regexp - keyword keyword |
1308 | 1319 | match = re.search(r'''(?ix)some text(?-i)''', line) |
1309 | 1320 | # ^ punctuation.definition.modifier.begin |
1310 | 1321 | # ^^ storage.modifier.mode |
|
1465 | 1476 | # ^^^^^ - keyword.operator |
1466 | 1477 | # ^^ keyword.operator.quantifier.regexp |
1467 | 1478 |
|
| 1479 | +fr"(?P<{name!s}>.*(?&{name})" |
| 1480 | +# ^^^ keyword.other.backref-and-recursion.regexp |
| 1481 | +# ^ punctuation.definition.capture-group-name.begin.regexp |
| 1482 | +# ^^^^^^^^ meta.string.python meta.interpolation.python |
| 1483 | +# ^ punctuation.section.interpolation.begin.python |
| 1484 | +# ^^^^ meta.generic-name.python |
| 1485 | +# ^^ storage.modifier.conversion.python |
| 1486 | +# ^ punctuation.section.interpolation.end.python |
| 1487 | +# ^ keyword.other.backref-and-recursion.regexp punctuation.definition.capture-group-name.end.regexp |
| 1488 | +# ^^ keyword.other.backref-and-recursion.regexp |
| 1489 | +# ^^^^^^ meta.string.python meta.interpolation.python |
| 1490 | +# ^ punctuation.section.interpolation.begin.python |
| 1491 | +# ^^^^ meta.generic-name.python |
| 1492 | +# ^ punctuation.section.interpolation.end.python |
| 1493 | +# ^ punctuation.section.group.end.regexp |
| 1494 | + |
| 1495 | +fr'(?P<{name!s}>.*(?&{name})' |
| 1496 | +# ^^^ keyword.other.backref-and-recursion.regexp |
| 1497 | +# ^ punctuation.definition.capture-group-name.begin.regexp |
| 1498 | +# ^^^^^^^^ meta.string.python meta.interpolation.python |
| 1499 | +# ^ punctuation.section.interpolation.begin.python |
| 1500 | +# ^^^^ meta.generic-name.python |
| 1501 | +# ^^ storage.modifier.conversion.python |
| 1502 | +# ^ punctuation.section.interpolation.end.python |
| 1503 | +# ^ keyword.other.backref-and-recursion.regexp punctuation.definition.capture-group-name.end.regexp |
| 1504 | +# ^^ keyword.other.backref-and-recursion.regexp |
| 1505 | +# ^^^^^^ meta.string.python meta.interpolation.python |
| 1506 | +# ^ punctuation.section.interpolation.begin.python |
| 1507 | +# ^^^^ meta.generic-name.python |
| 1508 | +# ^ punctuation.section.interpolation.end.python |
| 1509 | +# ^ punctuation.section.group.end.regexp |
| 1510 | + |
| 1511 | +fr"(?P={name!s})" |
| 1512 | +# ^^^ keyword.other.backref-and-recursion.regexp |
| 1513 | +# ^^^^^^^^ meta.string.python meta.interpolation.python |
| 1514 | +# ^ punctuation.section.interpolation.begin.python |
| 1515 | +# ^^^^ meta.generic-name.python |
| 1516 | +# ^^ storage.modifier.conversion.python |
| 1517 | +# ^ punctuation.section.interpolation.end.python |
| 1518 | +# ^ punctuation.section.group.end.regexp |
| 1519 | + |
| 1520 | +fr'(?P={name!s})' |
| 1521 | +# ^^^ keyword.other.backref-and-recursion.regexp |
| 1522 | +# ^^^^^^^^ meta.string.python meta.interpolation.python |
| 1523 | +# ^ punctuation.section.interpolation.begin.python |
| 1524 | +# ^^^^ meta.generic-name.python |
| 1525 | +# ^^ storage.modifier.conversion.python |
| 1526 | +# ^ punctuation.section.interpolation.end.python |
| 1527 | +# ^ punctuation.section.group.end.regexp |
| 1528 | + |
| 1529 | +fr"(?({name!s})yes|no)" |
| 1530 | +# ^ keyword.other.backref-and-recursion.regexp |
| 1531 | +# ^ keyword.other.backref-and-recursion.regexp punctuation.definition.capture-group-name.begin.regexp |
| 1532 | +# ^^^^^^^^ meta.string.python meta.interpolation.python |
| 1533 | +# ^ punctuation.section.interpolation.begin.python |
| 1534 | +# ^^^^ meta.generic-name.python |
| 1535 | +# ^^ storage.modifier.conversion.python |
| 1536 | +# ^ punctuation.section.interpolation.end.python |
| 1537 | +# ^ keyword.other.backref-and-recursion.regexp punctuation.definition.capture-group-name.end.regexp |
| 1538 | + |
| 1539 | +fr'(?({name!s})yes|no)' |
| 1540 | +# ^ keyword.other.backref-and-recursion.regexp |
| 1541 | +# ^ keyword.other.backref-and-recursion.regexp punctuation.definition.capture-group-name.begin.regexp |
| 1542 | +# ^^^^^^^^ meta.string.python meta.interpolation.python |
| 1543 | +# ^ punctuation.section.interpolation.begin.python |
| 1544 | +# ^^^^ meta.generic-name.python |
| 1545 | +# ^^ storage.modifier.conversion.python |
| 1546 | +# ^ punctuation.section.interpolation.end.python |
| 1547 | +# ^ keyword.other.backref-and-recursion.regexp punctuation.definition.capture-group-name.end.regexp |
| 1548 | + |
| 1549 | +fr"\g<{name!s}>" |
| 1550 | +# ^^ keyword.other.backref-and-recursion.regexp |
| 1551 | +# ^ punctuation.definition.capture-group-name.begin.regexp |
| 1552 | +# ^^^^^^^^ meta.string.python meta.interpolation.python |
| 1553 | +# ^ punctuation.section.interpolation.begin.python |
| 1554 | +# ^^^^ meta.generic-name.python |
| 1555 | +# ^^ storage.modifier.conversion.python |
| 1556 | +# ^ punctuation.section.interpolation.end.python |
| 1557 | +# ^ keyword.other.backref-and-recursion.regexp punctuation.definition.capture-group-name.end.regexp |
| 1558 | + |
| 1559 | +fr'\g<{name!s}>' |
| 1560 | +# ^^ keyword.other.backref-and-recursion.regexp |
| 1561 | +# ^ punctuation.definition.capture-group-name.begin.regexp |
| 1562 | +# ^^^^^^^^ meta.string.python meta.interpolation.python |
| 1563 | +# ^ punctuation.section.interpolation.begin.python |
| 1564 | +# ^^^^ meta.generic-name.python |
| 1565 | +# ^^ storage.modifier.conversion.python |
| 1566 | +# ^ punctuation.section.interpolation.end.python |
| 1567 | +# ^ keyword.other.backref-and-recursion.regexp punctuation.definition.capture-group-name.end.regexp |
| 1568 | + |
1468 | 1569 | # Most of these were inspired by |
1469 | 1570 | # https://github.com/python/cpython/commit/9a4135e939bc223f592045a38e0f927ba170da32 |
1470 | 1571 | f'{x=:}' |
|
0 commit comments