|
8 | 8 | # Named groups |
9 | 9 | # Names that start with a hyphen or digit (ascii or other) are invalid. |
10 | 10 | # ")" is only allowed as first char of the name. |
11 | | - # "!" is allowed anywhere, but ?<!...> is treated as a lookbehind by Ruby. |
| 11 | + # "!" and "=" are allowed anywhere, but (?<!…>…) and (?<=…>…) are treated as lookbehinds by Ruby. |
12 | 12 | include_examples 'scan', '(?<name>abc)', 0 => [:group, :named_ab, '(?<name>', 0, 8] |
13 | 13 | include_examples 'scan', "(?'name'abc)", 0 => [:group, :named_sq, "(?'name'", 0, 8] |
14 | 14 | include_examples 'scan', '(?<name_1>abc)', 0 => [:group, :named_ab, '(?<name_1>', 0,10] |
|
17 | 17 | include_examples 'scan', "(?'name-1'abc)", 0 => [:group, :named_sq, "(?'name-1'", 0,10] |
18 | 18 | include_examples 'scan', "(?<name'1>abc)", 0 => [:group, :named_ab, "(?<name'1>", 0,10] |
19 | 19 | include_examples 'scan', "(?'name>1'abc)", 0 => [:group, :named_sq, "(?'name>1'", 0,10] |
| 20 | + include_examples 'scan', "(?<n!me1'>abc)", 0 => [:group, :named_ab, "(?<n!me1'>", 0,10] |
| 21 | + include_examples 'scan', "(?'!ame1>'abc)", 0 => [:group, :named_sq, "(?'!ame1>'", 0,10] |
| 22 | + include_examples 'scan', "(?<n=me1'>abc)", 0 => [:group, :named_ab, "(?<n=me1'>", 0,10] |
| 23 | + include_examples 'scan', "(?'=ame1>'abc)", 0 => [:group, :named_sq, "(?'=ame1>'", 0,10] |
20 | 24 | include_examples 'scan', '(?<üüuuüü>abc)', 0 => [:group, :named_ab, '(?<üüuuüü>', 0,10] |
21 | 25 | include_examples 'scan', "(?'üüuuüü'abc)", 0 => [:group, :named_sq, "(?'üüuuüü'", 0,10] |
22 | 26 | include_examples 'scan', "(?<😋1234😋>abc)", 0 => [:group, :named_ab, "(?<😋1234😋>", 0,10] |
|
38 | 42 | include_examples 'scan', '(?=abc)', 0 => [:assertion, :lookahead, '(?=', 0, 3] |
39 | 43 | include_examples 'scan', '(?!abc)', 0 => [:assertion, :nlookahead, '(?!', 0, 3] |
40 | 44 | include_examples 'scan', '(?<=abc)', 0 => [:assertion, :lookbehind, '(?<=', 0, 4] |
| 45 | + include_examples 'scan', '(?<=x>)y', 0 => [:assertion, :lookbehind, '(?<=', 0, 4] |
41 | 46 | include_examples 'scan', '(?<!abc)', 0 => [:assertion, :nlookbehind, '(?<!', 0, 4] |
42 | 47 | include_examples 'scan', '(?<!x)y>', 0 => [:assertion, :nlookbehind, '(?<!', 0, 4] |
43 | 48 | include_examples 'scan', '(?<!x>)y', 0 => [:assertion, :nlookbehind, '(?<!', 0, 4] |
44 | | - include_examples 'scan', '(?<=x>)y', 0 => [:assertion, :lookbehind, '(?<=', 0, 4] |
45 | 49 |
|
46 | 50 | # Options |
47 | 51 | include_examples 'scan', '(?-mix:abc)', 0 => [:group, :options, '(?-mix:', 0, 7] |
|
0 commit comments