Skip to content

Commit 515aeb9

Browse files
committed
Add additional tests for negated /[^\P{Lu}]/i behaviour
PCRE2's behaviour matches Perl currently, and Python's regex module (the standard re module doesn't have \P{...}). However, JavaScript behaviour changed recently (when they added the new 'v' flag; the old 'u' flag's behaviour is unchanged), so this case is worth additional testing. Raised in issue PCRE2Project#497.
1 parent 6185344 commit 515aeb9

File tree

2 files changed

+96
-0
lines changed

2 files changed

+96
-0
lines changed

testdata/testinput4

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2913,4 +2913,40 @@
29132913
/c3 b1/hex,utf
29142914
\N{U+00F1}
29152915

2916+
/[^\P{Lu}1]/i,utf,ucp
2917+
a
2918+
A
2919+
\x{3a3}
2920+
\x{3c3}
2921+
\= Expect no match
2922+
1
2923+
2
2924+
2925+
/[^\P{Lu}1]/utf,ucp
2926+
A
2927+
\x{3a3}
2928+
\= Expect no match
2929+
1
2930+
2
2931+
a
2932+
\x{3c3}
2933+
2934+
/[\P{Lu}1]/i,utf,ucp
2935+
1
2936+
2
2937+
\= Expect no match
2938+
a
2939+
A
2940+
\x{3a3}
2941+
\x{3c3}
2942+
2943+
/[\P{Lu}1]/utf,ucp
2944+
1
2945+
2
2946+
a
2947+
\x{3c3}
2948+
\= Expect no match
2949+
A
2950+
\x{3a3}
2951+
29162952
# End of testinput4

testdata/testoutput4

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4662,4 +4662,64 @@ No match
46624662
\N{U+00F1}
46634663
0: \x{f1}
46644664

4665+
/[^\P{Lu}1]/i,utf,ucp
4666+
a
4667+
0: a
4668+
A
4669+
0: A
4670+
\x{3a3}
4671+
0: \x{3a3}
4672+
\x{3c3}
4673+
0: \x{3c3}
4674+
\= Expect no match
4675+
1
4676+
No match
4677+
2
4678+
No match
4679+
4680+
/[^\P{Lu}1]/utf,ucp
4681+
A
4682+
0: A
4683+
\x{3a3}
4684+
0: \x{3a3}
4685+
\= Expect no match
4686+
1
4687+
No match
4688+
2
4689+
No match
4690+
a
4691+
No match
4692+
\x{3c3}
4693+
No match
4694+
4695+
/[\P{Lu}1]/i,utf,ucp
4696+
1
4697+
0: 1
4698+
2
4699+
0: 2
4700+
\= Expect no match
4701+
a
4702+
No match
4703+
A
4704+
No match
4705+
\x{3a3}
4706+
No match
4707+
\x{3c3}
4708+
No match
4709+
4710+
/[\P{Lu}1]/utf,ucp
4711+
1
4712+
0: 1
4713+
2
4714+
0: 2
4715+
a
4716+
0: a
4717+
\x{3c3}
4718+
0: \x{3c3}
4719+
\= Expect no match
4720+
A
4721+
No match
4722+
\x{3a3}
4723+
No match
4724+
46654725
# End of testinput4

0 commit comments

Comments
 (0)