Include '_' in '\w' regex character class
This commit is contained in:
parent
8512af712e
commit
d3204d3526
2 changed files with 6 additions and 3 deletions
|
|
@ -35,7 +35,7 @@ describe("parse_regex", []() {
|
|||
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
|
||||
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
|
||||
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
|
||||
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
|
||||
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '_',
|
||||
}),
|
||||
character({ '-' }),
|
||||
character({ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' }) })
|
||||
|
|
|
|||
|
|
@ -174,8 +174,11 @@ class PatternParser {
|
|||
case 'a':
|
||||
return CharacterSet().include('a', 'z').include('A', 'Z');
|
||||
case 'w':
|
||||
return CharacterSet().include('a', 'z').include('A', 'Z').include('0',
|
||||
'9');
|
||||
return CharacterSet()
|
||||
.include('a', 'z')
|
||||
.include('A', 'Z')
|
||||
.include('0', '9')
|
||||
.include('_');
|
||||
case 'd':
|
||||
return CharacterSet().include('0', '9');
|
||||
case 't':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue