-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconftest-data.h
2876 lines (2866 loc) · 44.1 KB
/
conftest-data.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Generated on 2024/10/04.
struct testdata
{
int type;
const char *title;
const char *flags;
const char_type *re;
const char_type *str;
unsigned int offset;
unsigned int number;
const char_type *expected;
};
testdata tests[] = {
// Compilation error.
{
0, "Compilation error 01: Bad range.\n",
"E",
RE("[b-a]"),
STR(""),
srell::regex_constants::error_range, 0,
STR0("")
},
{
0, "Compilation error 02: Unknown escape in charclass.\n",
"E",
RE("[\\1]()"),
STR(""),
srell::regex_constants::error_escape, 0,
STR0("")
},
#if !defined(NO_VMODE)
{
0, "Compilation error 03: Complement of pos.\n",
"Ev",
RE("\\P{Basic_Emoji}"),
STR(""),
srell::regex_constants::error_complement, 0,
STR0("")
},
{
0, "Compilation error 04: Complement of pos charclass.\n",
"Ev",
RE("[^\\p{Basic_Emoji}]"),
STR(""),
srell::regex_constants::error_complement, 0,
STR0("")
},
#endif // !defined(NO_VMODE)
// Backreference.
{
0, "Backref 01.\n",
"",
RE("^(.*)*b\\1$"),
STR("aaaabaa"),
0, 2,
STR0("aaaabaa")
STR0("aa")
},
{
0, "Backref 02.\n",
"",
RE("^(.*)*b\\1\\1$"),
STR("aaaabaaaa"),
0, 2,
STR0("aaaabaaaa")
STR0("aa")
},
{
0, "Backref 03.\n",
"",
RE("(.*?)*b\\1"),
STR("ab"),
0, 2,
STR0("b")
STR0("")
},
{
0, "Backref 04.\n",
"",
RE("(a(.)a|\\2(.)b){2}"),
STR("acaaabbb"),
0, 4,
STR0("aaabb")
STR0("bb")
STR0("(undefined)")
STR0("b")
},
{
0, "Backref 05.\n",
"",
RE("(a*)(b)*\\1\\1\\1"),
STR("aabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbaaaaaa"),
0, 3,
STR0("aabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbaaaaaa")
STR0("aa")
STR0("b")
},
{
0, "Backref 06.\n",
"",
RE("()(?:\\1+)*"),
STR(""),
0, 2,
STR0("")
STR0("")
},
// Capture.
{
0, "Capture 01.\n",
"",
RE("(.*)*b"),
STR("aaaaaaaaaab"),
0, 2,
STR0("aaaaaaaaaab")
STR0("aaaaaaaaaa")
},
{
0, "Capture 02.\n",
"",
RE("(.*)+b"),
STR("aaaaaaaaaab"),
0, 2,
STR0("aaaaaaaaaab")
STR0("aaaaaaaaaa")
},
{
0, "Capture 03.\n",
"",
RE("(.*){2,}b"),
STR("aaaaaaaaaab"),
0, 2,
STR0("aaaaaaaaaab")
STR0("")
},
{
0, "Capture 04.\n",
"",
RE("(?=(a+))(abc)"),
STR("aaaaaaaaaabc"),
0, 3,
STR0("abc")
STR0("a")
STR0("abc")
},
{
0, "Capture 05.\n",
"",
RE("(\\d{4}[-]){3}\\d{3,4}"),
STR("1234-5678-9012-345"),
0, 2,
STR0("1234-5678-9012-345")
STR0("9012-")
},
// Repeat.
{
0, "Repeat 01: Capturing group.\n",
"",
RE("(([A-Z]+)|([a-z]+))+"),
STR("ABCabcDEFdef"),
0, 4,
STR0("ABCabcDEFdef")
STR0("def")
STR0("(undefined)")
STR0("def")
},
{
0, "Repeat 02: Non-capturing group.\n",
"",
RE("(?:([A-Z]+)|([a-z]+))+"),
STR("ABCabcDEFdef"),
0, 3,
STR0("ABCabcDEFdef")
STR0("(undefined)")
STR0("def")
},
// Non-ASCII character.
{
0, "Non-ASCII 01.\n",
"",
RE("\\u3042*\\u3044"),
STR("\\u3042\\u3042\\u3042\\u3044"),
0, 1,
STR0("\\u3042\\u3042\\u3042\\u3044")
},
{
0, "Non-ASCII 02.\n",
"",
RE("(.).\\1"),
STR("\\u3068\\u307E\\u307E\\u3068\\u30C8\\u30DE\\u30DE\\u30C8\\u3068\\u307E\\u3068"),
0, 2,
STR0("\\u3068\\u307E\\u3068")
STR0("\\u3068")
},
// Case-insensitive, icase.
{
0, "Icase 01: Icase range.\n",
"iG",
RE("[Z-a]+"),
STR("0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"),
0, 3,
STR0("A")
STR0("Z[\\]^_`a")
STR0("z")
},
{
0, "Icase 02: Sigma, case-sensitive.\n",
"",
RE("\\u03C3+"),
STR("\\u03A3\\u03C3\\u03C2\\u30A2\\u30A4\\u30A6\\u{1B000}\\u30AA\\u3084\\u3086\\u{1B001}\\u3088"),
0, 1,
STR0("\\u03C3")
},
{
0, "Icase 03: Sigma, nocase.\n",
"i",
RE("\\u03C3+"),
STR("\\u03A3\\u03C3\\u03C2\\u30A2\\u30A4\\u30A6\\u{1B000}\\u30AA\\u3084\\u3086\\u{1B001}\\u3088"),
0, 1,
STR0("\\u03A3\\u03C3\\u03C2")
},
// Unicode property.
{
0, "Unicode property 01: Kana.\n",
"",
RE("(?:(\\p{sc=Hiragana}+)|(\\p{sc=Katakana}+))+"),
STR("\\u03A3\\u03C3\\u03C2\\u30A2\\u30A4\\u30A6\\u{1B000}\\u30AA\\u3084\\u3086\\u{1B001}\\u3088"),
0, 3,
STR0("\\u30A2\\u30A4\\u30A6\\u{1B000}\\u30AA\\u3084\\u3086\\u{1B001}\\u3088")
STR0("\\u3084\\u3086\\u{1B001}\\u3088")
STR0("(undefined)")
},
{
0, "Unicode property 02: Kana in charclass.\n",
"",
RE("[\\p{sc=Hiragana}\\p{sc=Katakana}]+"),
STR("\\u03A3\\u03C3\\u03C2\\u30A2\\u30A4\\u30A6\\u{1B000}\\u30AA\\u3084\\u3086\\u{1B001}\\u3088"),
0, 1,
STR0("\\u30A2\\u30A4\\u30A6\\u{1B000}\\u30AA\\u3084\\u3086\\u{1B001}\\u3088")
},
{
0, "Unicode property 03: Kana in complement charclass.\n",
"",
RE("[^\\p{sc=Hiragana}]+"),
STR("\\u03A3\\u03C3\\u03C2\\u30A2\\u30A4\\u30A6\\u{1B000}\\u30AA\\u3084\\u3086\\u{1B001}\\u3088"),
0, 1,
STR0("\\u03A3\\u03C3\\u03C2\\u30A2\\u30A4\\u30A6\\u{1B000}\\u30AA")
},
// regex_match, match_continuous.
{
0, "regex_match 01.\n",
"M",
RE("\\w*"),
STR("abcd"),
0, 1,
STR0("abcd")
},
{
0, "regex_match 02.\n",
"M",
RE("\\w*"),
STR("@abcd"),
0, 0,
STR0("")
},
{
0, "regex_match 03.\n",
"M",
RE("\\w*"),
STR("abcd@"),
0, 0,
STR0("")
},
{
0, "match_continous 01.\n",
"y",
RE("\\w+"),
STR("abcd"),
0, 1,
STR0("abcd")
},
{
0, "match_continuous 02.\n",
"y",
RE("\\w+"),
STR("@abcd"),
0, 0,
STR0("")
},
{
0, "match_continuous 03.\n",
"y",
RE("\\w+"),
STR("abcd@"),
0, 1,
STR0("abcd")
},
// Boyer-Moore-Horspool. BMH.
{
0, "BMH 01s: Case-sensitive search 1.\n",
"",
RE("AbCd"),
STR("AbCd"),
0, 1,
STR0("AbCd")
},
{
0, "BMH 01m: Case-sensitive match 1.\n",
"M",
RE("AbCd"),
STR("AbCd"),
0, 1,
STR0("AbCd")
},
{
0, "BMH 02s: Case-sensitive search 2.\n",
"",
RE("AbCd"),
STR("aBcD"),
0, 0,
STR0("")
},
{
0, "BMH 02m: Case-sensitive match 2.\n",
"M",
RE("AbCd"),
STR("aBcD"),
0, 0,
STR0("")
},
{
0, "BMH 03s: Icase search.\n",
"i",
RE("AbCd"),
STR("aBcD"),
0, 1,
STR0("aBcD")
},
{
0, "BMH 03m: Icase match.\n",
"iM",
RE("AbCd"),
STR("aBcD"),
0, 1,
STR0("aBcD")
},
// Broken/corrupted UTF-8.
{
0, "Broken UTF-8 01: Match found.\n",
"M",
RE("[\\w ]+"),
STR("ABC 0123456789 xyz"),
0, 1,
STR0("ABC 0123456789 xyz")
},
{
8, "Broken UTF-8 02: Match not found. \\x80 prevents fullmatch.\n",
"M",
RE("\\S*"),
STR("\x80""ABC 0123456789 xyz"),
0, 0,
STR0("")
},
{
8, "Broken UTF-8 03: Search failure. \\x80 prevents search with ^.\n",
"",
RE("^\\S*$"),
STR("\x80""ABC 0123456789 xyz"),
0, 0,
STR0("")
},
{
8, "Broken UTF-8 04: Search failure. \\x80 prevents search with ^ and match_continuous.\n",
"y",
RE("^\\S*$"),
STR("\x80""ABC 0123456789 xyz"),
0, 0,
STR0("")
},
{
8, "Broken UTF-8 05: Search failure. \\x80 prevents search with match_continuous.\n",
"y",
RE("\\S*$"),
STR("\x80""ABC 0123456789 xyz"),
0, 0,
STR0("")
},
{
8, "Broken UTF-8 06: Search failure. \\x80 prevents search with $.\n",
"",
RE("\\S+$"),
STR("ABC 0123456789 xyz\x80"),
0, 0,
STR0("")
},
{
8, "Broken UTF-8 07a: 0 width match after \\x80 succeeds 1.\n",
"",
RE("\\S*$"),
STR("ABC 0123456789 xyz\x80"),
0, 1,
STR0("")
},
{
8, "Broken UTF-8 07b: 0 width match after \\x80 succeeds 2.\n",
"",
RE("$"),
STR("\x80"),
0, 1,
STR0("")
},
{
0, "Broken UTF-8 08: Match found, empty string.\n",
"M",
RE("^$"),
STR(""),
0, 1,
STR0("")
},
{
8, "Broken UTF-8 09: Match not found. \\x80 must not be ignored by match with /^$/.\n",
"M",
RE("^$"),
STR("\x80"),
0, 0,
STR0("")
},
{
8, "Broken UTF-8 10: Search failure. \\x80 must not be ignored by search with /^$/.\n",
"",
RE("^$"),
STR("\x80"),
0, 0,
STR0("")
},
{
8, "Broken UTF-8 11: Match not found. \\x80 prevents match with /$/.\n",
"M",
RE("$"),
STR("\x80"),
0, 0,
STR0("")
},
{
8, "Broken UTF-8 & BMH 01: Preceding \\x80 must be ignored.\n",
"",
RE("ABC"),
STR("\x80""ABC"),
0, 1,
STR0("ABC")
},
{
8, "Broken UTF-8 & BMH 02: Trailing \\x80 must be ignored.\n",
"",
RE("ABC"),
STR("ABC\x80"),
0, 1,
STR0("ABC")
},
{
8, "Broken UTF-8 & BMH 03: Icase, preceding \\x80 must be igored.\n",
"i",
RE("ABC"),
STR("\x80""abc"),
0, 1,
STR0("abc")
},
{
8, "Broken UTF-8 & BMH 04: Icase, trailing \\x80 must be igored.\n",
"i",
RE("ABC"),
STR("abc\x80"),
0, 1,
STR0("abc")
},
{
8, "Broken UTF-8 & BMH 05: Non-ASCII, trailing \\x80.\n",
"",
RE("\\u3042\\u3044"),
STR("\\u3042\\u3044\x80"),
0, 1,
STR0("\\u3042\\u3044")
},
{
8, "Broken UTF-8 & BMH 06: Non-ASCII, icase, trailing \\x80.\n",
"i",
RE("\\u3042\\u3044"),
STR("\\u3042\\u3044\x80"),
0, 1,
STR0("\\u3042\\u3044")
},
{
8, "Broken UTF-8 & BMH 07: Non-ASCII, embedded \\x80 1.\n",
"",
RE("\\u3042\\u3044"),
STR("\\u3042")STR("\x80")STR("\\u3044"),
0, 0,
STR0("")
},
{
8, "Broken UTF-8 & BMH 08: Non-ASCII, icase, embedded \\x80 1.\n",
"i",
RE("\\u3042\\u3044"),
STR("\\u3042")STR("\x80")STR("\\u3044"),
0, 0,
STR0("")
},
{
8, "Broken UTF-8 & BMH 09: Non-ASCII, embedded \\x80 2.\n",
"",
RE("\\u3042\\u3044"),
STR("\\u3042\x80\\u3044\\u3042\\u3044"),
0, 1,
STR0("\\u3042\\u3044")
},
{
8, "Broken UTF-8 & BMH 10: Non-ASCII, icase, embedded \\x80 2.\n",
"i",
RE("\\u3042\\u3044"),
STR("\\u3042\x80\\u3044\\u3042\\u3044"),
0, 1,
STR0("\\u3042\\u3044")
},
// Duplicate named capturing group.
{
0, "Duplicate named capture 01.\n",
"N",
RE("(?<year>\\d{4})[/-](?<month>[A-Za-z]+)[/-](?<day>\\d{1,2})|(?<day>\\d{1,2})[/-](?<month>[A-Za-z]+)[/-](?<year>\\d{4})|(?<month>[A-Za-z]+)[/-](?<day>\\d{1,2})[/-](?<year>\\d{4})"),
STR("2024-May-26"),
0, 10,
STR0("2024-May-26")
STR0("2024 <year>")
STR0("May <month>")
STR0("26 <day>")
STR0("(undefined)")
STR0("(undefined)")
STR0("(undefined)")
STR0("(undefined)")
STR0("(undefined)")
STR0("(undefined)")
},
{
0, "Duplicate named capture 02.\n",
"N",
RE("(?<year>\\d{4})[/-](?<month>[A-Za-z]+)[/-](?<day>\\d{1,2})|(?<day>\\d{1,2})[/-](?<month>[A-Za-z]+)[/-](?<year>\\d{4})|(?<month>[A-Za-z]+)[/-](?<day>\\d{1,2})[/-](?<year>\\d{4})"),
STR("26-May-2024"),
0, 10,
STR0("26-May-2024")
STR0("(undefined)")
STR0("(undefined)")
STR0("(undefined)")
STR0("26 <day>")
STR0("May <month>")
STR0("2024 <year>")
STR0("(undefined)")
STR0("(undefined)")
STR0("(undefined)")
},
{
0, "Duplicate named capture 03.\n",
"N",
RE("(?<year>\\d{4})[/-](?<month>[A-Za-z]+)[/-](?<day>\\d{1,2})|(?<day>\\d{1,2})[/-](?<month>[A-Za-z]+)[/-](?<year>\\d{4})|(?<month>[A-Za-z]+)[/-](?<day>\\d{1,2})[/-](?<year>\\d{4})"),
STR("May-26-2024"),
0, 10,
STR0("May-26-2024")
STR0("(undefined)")
STR0("(undefined)")
STR0("(undefined)")
STR0("(undefined)")
STR0("(undefined)")
STR0("(undefined)")
STR0("May <month>")
STR0("26 <day>")
STR0("2024 <year>")
},
// Lookbehind.
{
0, "Three iterators 01: Search succeeds.\n",
"3",
RE("(?<=^\\d+).+"),
STR("0123abcd"),
4, 1,
STR0("abcd")
},
{
0, "Three iterators 02: Search fails.\n",
"3",
RE("(?<=^\\d+).+"),
STR("0123abcd"),
5, 0,
STR0("")
},
{
0, "Three iteratorts 03: Match fails.\n",
"3M",
RE("(?<=^\\d+).+"),
STR("0123abcd"),
4, 0,
STR0("")
},
// Character class escapes.
{
0, "CharacterClassEscape 01.\n",
"",
RE("\\w+"),
STR("abcd,efgh"),
0, 1,
STR0("abcd")
},
{
0, "CharacterClassEscape 02.\n",
"",
RE("\\W+"),
STR("abcd,efgh"),
0, 1,
STR0(",")
},
{
0, "CharacterClassEscape 03.\n",
"",
RE("[\\w]+"),
STR("abcd,efgh"),
0, 1,
STR0("abcd")
},
{
0, "CharacterClassEscape 04.\n",
"",
RE("[\\W]+"),
STR("abcd,efgh"),
0, 1,
STR0(",")
},
// Icase and compelement of \p problem:
// https://github.com/tc39/proposal-regexp-v-flag/issues/30
{
0, "U-mode icase property 01: Complement.\n",
"i",
RE("\\P{Ll}+"),
STR("aAbBcCdD4#"),
0, 1,
STR0("aAbBcCdD4#")
},
{
0, "U-mode icase property 02: In charclass.\n",
"i",
RE("[\\p{Ll}]+"),
STR("aAbBcCdD4#"),
0, 1,
STR0("aAbBcCdD")
},
{
0, "U-mode icase peroperty 03: Double complements.\n",
"i",
RE("[^\\P{Ll}]+"),
STR("aAbBcCdD4#"),
0, 0,
STR0("")
},
#if !defined(NO_VMODE)
// Vmode, v-mode, v mode, v-flag mode, v flag, unicodesets, pos.
{
0, "Property complement in charclass 01: U-mode.\n",
"",
RE("[\\P{Ll}]+"),
STR("ABCDefgh"),
0, 1,
STR0("ABCD")
},
{
0, "Property complement in charclass 02: V-mode.\n",
"v",
RE("[\\P{Ll}]+"),
STR("ABCDefgh"),
0, 1,
STR0("ABCD")
},
{
0, "Property complement in charclass 03: U-mode, icase.\n",
"i",
RE("[\\P{Ll}]+"),
STR("ABCDefgh"),
0, 1,
STR0("ABCDefgh")
},
{
0, "Property complement in charclass 04: V-mode, icase (Different from u-mode).\n",
"iv",
RE("[\\P{Ll}]+"),
STR("ABCDefgh"),
0, 0,
STR0("")
},
// V-mode, properties.
{
0, "V-mode property 01.\n",
"vA",
RE("\\p{RGI_Emoji}"),
STR("\\u{1F468}\\u200D\\u2764\\uFE0F\\u200D\\u{1F48B}\\u200D\\u{1F468}\\u{1F3FB}"),
0, 2,
STR0("\\u{1F468}\\u200D\\u2764\\uFE0F\\u200D\\u{1F48B}\\u200D\\u{1F468}")
STR0("\\u{1F3FB}")
},
{
0, "V-mode property 02.\n",
"v",
RE("^\\p{RGI_Emoji}$"),
STR("\\u{1F468}\\u200D\\u2764\\uFE0F\\u200D\\u{1F48B}\\u200D\\u{1F468}\\u{1F3FB}"),
0, 0,
STR0("")
},
// V-mode, strings.
{
0, "V-mode string 01: Longest string first matched 01.\n",
"v",
RE("[\\q{abc|cde|ab|d|f}]+"), // abc -> d. Not ab -> cde -> f.
STR("abcde"),
0, 1,
STR0("abcd")
},
{
0, "V-mode string 02: $ causes backtracking.\n",
"v",
RE("[\\q{abc|cde|ab|d|f}]+$"), // ab -> cde -> f.
STR("abcdef"),
0, 1,
STR0("abcdef")
},
{
0, "V-mode 03: String icase 01.\n",
"iv",
RE("[\\q{cH|C}]+"),
STR("cch"),
0, 1,
STR0("cch")
},
{
0, "V-mode 04: String icase 02.\n",
"iv",
RE("[\\q{ChH|cH}]+"),
STR("chchh"),
0, 1,
STR0("chchh")
},
#endif // !defined(NO_VMODE)
// Undefined backreferences.
{
0, "UndefinedBackref 01.\n",
"",
RE("(\\1*)"),
STR(""),
0, 2,
STR0("")
STR0("")
},
{
0, "UndefinedBackref 02.\n",
"",
RE("\\1+()"),
STR(""),
0, 2,
STR0("")
STR0("")
},
{
0, "UndefinedBackref 03.\n",
"",
RE("^((\\1+)|\\d)+123$"),
STR("000123"),
0, 3,
STR0("000123")
STR0("0")
STR0("(undefined)")
},
{
0, "UndefinedBackref 04.\n",
"",
RE("(?:\\1+)*()"),
STR(""),
0, 2,
STR0("")
STR0("")
},
{
0, "UndefinedBackref 05.\n",
"",
RE("(\\2)(\\1)"),
STR(""),
0, 3,
STR0("")
STR0("")
STR0("")
},
{
0, "UndefinedBackref 06.\n",
"",
RE("(?:(\\d+)|([a-z]*))\\1_"),
STR("_"),
0, 3,
STR0("_")
STR0("(undefined)")
STR0("")
},
// Flag modifiers.
{
0, "UBModifiers 01: (?i) 01.\n",
"",
RE("(?i)aeiou"),
STR("AEIOU"),
0, 1,
STR0("AEIOU")
},
{
0, "UBModifiers 02: (?-i) 01.\n",
"i",
RE("(?-i)aeiou"),
STR("AEIOU"),
0, 0,
STR0("")
},
{
0, "UBModifiers 03: (?m) 01.\n",
"",
RE("(?m)abc$\\n^def"),
STR("abc\ndef"),
0, 1,
STR0("abc\ndef")
},
{
0, "UBModifiers 04: (?-m) 01.\n",
"",
RE("(?-m)abc$\\n^def"),
STR("abc\ndef"),
0, 0,
STR0("")
},
{
0, "UBModifiers 05: (?s) 01.\n",
"",
RE("(?s)abc.def"),
STR("abc\ndef"),
0, 1,
STR0("abc\ndef")
},
{
0, "UBModifiers 06: (?-s) 01.\n",
"",
RE("(?-s)abc$^def"),
STR("abc\ndef"),
0, 0,
STR0("")
},
{
0, "Modifiers 01: m-flag #1.\n",
"",
RE("(?m:[^]*?$)"),
STR("abcd\nefgh\n"),
0, 1,
STR0("abcd")
},
{
0, "Modifiers 02: m-flag #2.\n",
"m",
RE("(?-m:[^]*?$)"),
STR("abcd\nefgh\n"),
0, 1,
STR0("abcd\nefgh\n")
},
{
0, "Modifiers 03: s-flag #1.\n",
"",
RE("(.*)(?s:.*)"),
STR("abcd\nefgh\n"),
0, 2,
STR0("abcd\nefgh\n")
STR0("abcd")
},
{
0, "Modifiers 04: s-flag #2.\n",
"s",
RE("(.*)(?-s:.)"),
STR("abcd\nefgh\n"),
0, 2,
STR0("abcd\nefgh")
STR0("abcd\nefg")
},
{
0, "Modifiers 05: i-flag #1.\n",
"",
RE("(?i:[a-z]+)"),
STR("aBcD"),
0, 1,
STR0("aBcD")
},
{
0, "Modifiers 06: i-flag #2.\n",
"i",
RE("(?-i:[a-z]+)"),
STR("aBcD"),
0, 1,
STR0("a")
},
{
0, "Modifiers 07: i-flag #3.\n",
"G",
RE("(a)(?i:\\1)"),
STR("aa aA Aa AA"),
0, 2,
STR0("aa")
STR0("aA")
},
{
0, "Modifiers 08: i-flag #4.\n",
"iG",
RE("(a)(?-i:\\1)"),
STR("aa aA Aa AA"),
0, 2,
STR0("aa")
STR0("AA")
},
// Optimisations' side effect check.
// gather_nextchars().
{
0, "OSEC, GNC 01: Greedy and ^.\n",
"m",
RE("[^;]*^;?"),
STR("\n0"),
0, 1,
STR0("\n")
},
{
0, "GNS 02: Non-greedy and ^.\n",
"m",
RE("[^;]*?^;?"),
STR("\n0"),
0, 1,
STR0("")
},
{
0, "OSEC, GNC 03: Greedy and $.\n",
"m",
RE("[^;]*$;?"),
STR("\n;"),
0, 1,
STR0("")
},
{
0, "OSEC, GNC 04: Non-greedy and $.\n",
"m",
RE("[^;]*?$;?"),
STR("\n;"),
0, 1,
STR0("")
},
{
0, "OSEC, GNC 05: Non-multiline.\n",
"",
RE("[^;]*^;?"),
STR("\n0"),
0, 1,
STR0("")
},
{
0, "OSEC, GNC 06: Lookaround, greedy.\n",
"",
RE("[^;]*(?<=abc);?"),
STR("abcd"),
0, 1,
STR0("abc")
},
{
0, "OSEC, GNC 07: Lookaround, non-greedy.\n",
"",
RE("[^;]*?(?<=abc);?"),
STR("abcd"),
0, 1,
STR0("abc")
},
{
0, "OSEC, GNC 08: Lookbehind with $.\n",
"m",
RE("(?<=$.*)"),
STR("abcd"),
0, 1,
STR0("")
},
// Entry point selector version 1 (Implemented in SRELL 3.000).
{
0, "OSEC, EPS 01.\n",
"M",
RE("[a-z]*, [a-z]"),
STR("abcd, e"),