-
Notifications
You must be signed in to change notification settings - Fork 135
/
rx.t
executable file
·2941 lines (2148 loc) · 102 KB
/
rx.t
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
use Test;
plan 733;
### for now
sub matchcheck(*@) { 1 }
# L<S05/Backtracking control/"To force the preceding atom to do no
# backtracking">
## Backtracking control tests
#### a* a bazaar y control
#?pugs todo
ok 'bazaar' ~~ /a* a/, 'control';
#### a*: a bazaar n basic
ok !('bazaar' ~~ /a*: a/), 'basic';
#### ^[a|b]* aba abbabbababba y control
#?pugs todo
ok 'abbabbababba' ~~ /^[a|b]* aba/, 'control';
#### ^[a|b]*: aba abbabbababba n outside a group
ok !('abbabbababba' ~~ /^[a|b]*: aba/), 'outside a group';
#### \d+: 123abc y cut on character class shortcut
#?pugs todo
ok '123abc' ~~ /\d+:/, 'cut on character class shortcut';
#### \d+: abc n cut on character class shortcut
ok 'abc' !~~ /\d+:/, 'cut on character class shortcut';
#### [ if not | ify ] verify y control
#?pugs todo
ok 'verify' ~~ /[ if not | ify ]/, 'control';
# L<S05/Backtracking control/"Evaluating a double colon">
#### [ if :: not | ify ] verify n inside a group
#?rakudo skip ':: NYI'
#?niecza todo ':: issues'
ok 'verify' !~~ /[ if :: not | ify ]/, 'inside a group';
#### if :: not | ify verify n the default all group
#?rakudo skip ':: NYI'
#?niecza todo ':: issues'
ok 'verify' !~~ / if :: not | ify/, 'the default all group';
#### [ if : not | ify ] verify y simple backtrack still works
#?pugs todo
ok 'verify' ~~ /[ if : not | ify ]/, 'simple backtrack still works';
#### [ if :: not | ify ] | verify verify y rule continues
#?rakudo skip ':: NYI'
#?pugs todo
ok 'verify' ~~ /[ if :: not | ify ] | verify/, 'rule continues';
# L<S05/Backtracking control/"Evaluating a triple colon">
#### [ when ever ] | whence whence y full backtrack failure
#?pugs todo
ok 'whence' ~~ /[ when ever ] | whence/, 'full backtrack failure';
#### [ when ::: ever ] | whence whence n full backtrack failure
#?rakudo skip '::: NYI'
#?niecza todo '::: issue'
ok 'whence' !~~ /[ when ::: ever ] | whence/, 'full backtrack failure';
#### ab::cd | gh::ij xyabghij y group cut at top
#?rakudo skip ':: NYI'
#?pugs todo
ok 'xyabghij' ~~ /ab::cd | gh::ij/, 'group cut at top';
#### ab:::cd | gh:::ij xyabghij n rule cut at top
#?rakudo skip ':: NYI'
#?niecza todo '::: issue'
ok 'xyabghij' !~~ /ab:::cd | gh:::ij/, 'rule cut at top';
#### [ab::cd | gh::ij] xyabghij y group cut in group
#?rakudo skip ':: NYI'
#?pugs todo
ok 'xyabghij' ~~ /[ab::cd | gh::ij]/, 'group cut in group';
#### [ab:::cd | gh:::ij] xyabghij n rule cut in group
#?rakudo skip '::: NYI'
#?niecza todo '::: issue'
ok 'xyabghij' !~~ /[ab:::cd | gh:::ij]/, 'rule cut in group';
#### [ ab | abc ]: de xyzabcde n no backtrack into group
#?rakudo todo 'nom regression'
#?niecza todo ''
ok 'xyzabcde' !~~ /[ ab | abc ]: de/, 'no backtrack into group';
#### ( ab | abc ): de xyzabcde n no backtrack into subpattern
ok 'xyzabcde' !~~ /( ab || abc ): de/, 'no backtrack into subpattern';
#### [ when <commit> ever ] | whence whence n full backtrack failure
#?rakudo skip '<commit> not implemented'
#?niecza todo ''
ok 'whence' !~~ /[ when <commit> ever ] | whence/, 'full backtrack failure';
#L<S05/Modifiers/"The new :r or :ratchet modifier">
#### :ratchet a* a bazaar n ratchet modifier
ok 'bazaar' !~~ /:ratchet a* a/, 'ratchet modifier';
#### :ratchet a*! a bazaar y force backtracking !
#?pugs todo
ok 'bazaar' ~~ /:ratchet a*! a/, 'force backtracking !';
#L<S05/Unchanged syntactic features/"Capturing: (...)">
## captures
#### (a.)..(..) zzzabcdefzzz y basic match
#?pugs todo
ok 'zzzabcdefzzz' ~~ /(a.)..(..)/, 'basic match';
#### (a.)..(..) zzzabcdefzzz /mob: <abcdef @ 3>/ basic $/
#?pugs todo
ok ('zzzabcdefzzz' ~~ /(a.)..(..)/) && matchcheck($/, q/mob: <abcdef @ 3>/), 'basic $/';
#### (a.)..(..) zzzabcdefzzz /mob 0: <ab @ 3>/ basic $0
#?pugs todo
ok ('zzzabcdefzzz' ~~ /(a.)..(..)/) && matchcheck($/, q/mob 0: <ab @ 3>/), 'basic $0';
#### (a.)..(..) zzzabcdefzzz /mob 1: <ef @ 7>/ basic $1
#?pugs todo
ok ('zzzabcdefzzz' ~~ /(a.)..(..)/) && matchcheck($/, q/mob 1: <ef @ 7>/), 'basic $1';
#### (a(b(c))(d)) abcd y nested match
#?pugs todo
ok 'abcd' ~~ /(a(b(c))(d))/, 'nested match';
#### (a(b(c))(d)) abcd /mob: <abcd @ 0>/ nested match
#?pugs todo
ok ('abcd' ~~ /(a(b(c))(d))/) && matchcheck($/, q/mob: <abcd @ 0>/), 'nested match';
#### (a(b(c))(d)) abcd /mob 0: <abcd @ 0>/ nested match
#?pugs todo
ok ('abcd' ~~ /(a(b(c))(d))/) && matchcheck($/, q/mob 0: <abcd @ 0>/), 'nested match';
#### (a(b(c))(d)) abcd /mob 0 0: <bc @ 1>/ nested match
#?pugs todo
ok ('abcd' ~~ /(a(b(c))(d))/) && matchcheck($/, q/mob 0 0: <bc @ 1>/), 'nested match';
#### (a(b(c))(d)) abcd /mob 0 0 0: <c @ 2>/ nested match
#?pugs todo
ok ('abcd' ~~ /(a(b(c))(d))/) && matchcheck($/, q/mob 0 0 0: <c @ 2>/), 'nested match';
#### (a(b(c))(d)) abcd /mob 0 1: <d @ 3>/ nested match
#?pugs todo
ok ('abcd' ~~ /(a(b(c))(d))/) && matchcheck($/, q/mob 0 1: <d @ 3>/), 'nested match';
#### ((\w+)+) abcd /mob: <abcd @ 0>/ nested match
#?pugs todo
ok ('abcd' ~~ /((\w+)+)/) && matchcheck($/, q/mob: <abcd @ 0>/), 'nested match';
#### ((\w+)+) abcd /mob 0: <abcd @ 0>/ nested match
#?pugs todo
ok ('abcd' ~~ /((\w+)+)/) && matchcheck($/, q/mob 0: <abcd @ 0>/), 'nested match';
#### ((\w+)+) abcd /mob 0 0 0: <abcd @ 0>/ nested match
#?pugs todo
ok ('abcd' ~~ /((\w+)+)/) && matchcheck($/, q/mob 0 0 0: <abcd @ 0>/), 'nested match';
#### ((\w+)+) ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz /mob: <ABCD/ nested match
#?pugs todo
ok ('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' ~~ /((\w+)+)/) && matchcheck($/, q/mob: <ABCD/), 'nested match';
#### ((\w+)+) ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz /mob 0: <ABCD/ nested match
#?pugs todo
ok ('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' ~~ /((\w+)+)/) && matchcheck($/, q/mob 0: <ABCD/), 'nested match';
#### ((\w+)+) ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz /mob 0 0 0: <ABCD/ nested match
#?pugs todo
ok ('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' ~~ /((\w+)+)/) && matchcheck($/, q/mob 0 0 0: <ABCD/), 'nested match';
#### (a) [ (bc) (d) | .* (ef) ] .* (g) abcdefg /mob 0: <a @ 0>/ alt subpattern before group
#?pugs todo
ok ('abcdefg' ~~ /(a) [ (bc) (d) | .* (ef) ] .* (g)/) && matchcheck($/, q/mob 0: <a @ 0>/), 'alt subpattern before group';
#### (a) [ (bc) (d) | .* (ef) ] .* (g) abcdefg /mob 1: <bc @ 1>/ alt subpattern in group
#?pugs todo
ok ('abcdefg' ~~ /(a) [ (bc) (d) | .* (ef) ] .* (g)/) && matchcheck($/, q/mob 1: <bc @ 1>/), 'alt subpattern in group';
#### (a) [ (bc) (d) | .* (ef) ] .* (g) abcdefg /mob 2: <d @ 3>/ alt subpattern in group
#?pugs todo
ok ('abcdefg' ~~ /(a) [ (bc) (d) | .* (ef) ] .* (g)/) && matchcheck($/, q/mob 2: <d @ 3>/), 'alt subpattern in group';
#### (a) [ (bc) (d) | .* (ef) ] .* (g) abcdefg /mob 3: <g @ 6>/ alt subpattern after group
#?pugs todo
ok ('abcdefg' ~~ /(a) [ (bc) (d) | .* (ef) ] .* (g)/) && matchcheck($/, q/mob 3: <g @ 6>/), 'alt subpattern after group';
#### (a) [ (bc) (x) | .* (ef) ] .* (g) abcdefg /mob 1: <ef @ 4>/ 2nd alt subpattern in group
#?pugs todo
ok ('abcdefg' ~~ /(a) [ (bc) (x) | .* (ef) ] .* (g)/) && matchcheck($/, q/mob 1: <ef @ 4>/), '2nd alt subpattern in group';
#### (a) [ (bc) (x) | .* (ef) ] .* (g) abcdefg /mob 3: <g @ 6>/ 2nd alt subpattern after group
#?pugs todo
ok ('abcdefg' ~~ /(a) [ (bc) (x) | .* (ef) ] .* (g)/) && matchcheck($/, q/mob 3: <g @ 6>/), '2nd alt subpattern after group';
#### ( (.) )* abc /mob 0 1 0: <b @ 1>/ nested repeated captures
#?pugs todo
ok ('abc' ~~ /( (.) )*/) && matchcheck($/, q/mob 0 1 0: <b @ 1>/), 'nested repeated captures';
#### [ (.) ]* abc /mob 0 1: <b @ 1>/ nested repeated captures
#?pugs todo
ok ('abc' ~~ /[ (.) ]*/) && matchcheck($/, q/mob 0 1: <b @ 1>/), 'nested repeated captures';
#### ( [.] )* abc /mob 0 1: <b @ 1>/ nested repeated captures
#?pugs todo
ok ('abc' ~~ /( [ . ] )*/) && matchcheck($/, q/mob 0 1: <b @ 1>/), 'nested repeated captures';
#### (.) (.) $7=(.) (.) $4=(.) abcdefg /mob 0: <a @ 0>/ numbered aliases $0
#?pugs todo
ok ('abcdefg' ~~ /(.) (.) $7=(.) (.) $4=(.)/) && matchcheck($/, q/mob 0: <a @ 0>/), 'numbered aliases $0';
#### (.) (.) $7=(.) (.) $4=(.) abcdefg /mob 1: <b @ 1>/ numbered aliases $1
#?pugs todo
ok ('abcdefg' ~~ /(.) (.) $7=(.) (.) $4=(.)/) && matchcheck($/, q/mob 1: <b @ 1>/), 'numbered aliases $1';
#### (.) (.) $7=(.) (.) $4=(.) abcdefg /mob 7: <c @ 2>/ numbered aliases $7
#?pugs todo
ok ('abcdefg' ~~ /(.) (.) $7=(.) (.) $4=(.)/) && matchcheck($/, q/mob 7: <c @ 2>/), 'numbered aliases $7';
#### (.) (.) $7=(.) (.) $4=(.) abcdefg /mob 8: <d @ 3>/ numbered aliases $8
#?pugs todo
ok ('abcdefg' ~~ /(.) (.) $7=(.) (.) $4=(.)/) && matchcheck($/, q/mob 8: <d @ 3>/), 'numbered aliases $8';
#### (.) (.) $7=(.) (.) $4=(.) abcdefg /mob 4: <e @ 4>/ numbered aliases $4
#?pugs todo
ok ('abcdefg' ~~ /(.) (.) $7=(.) (.) $4=(.)/) && matchcheck($/, q/mob 4: <e @ 4>/), 'numbered aliases $4';
#### $1=[ (.) (.) (.) ] (.) abcdefg /mob 1: <abc @ 0>/ perl5 numbered captures $1
#?pugs todo
ok ('abcdefg' ~~ /$1=[ (.) (.) (.) ] (.)/) && matchcheck($/, q/mob 1: <abc @ 0>/), 'perl5 numbered captures $1';
#### $1=[ (.) (.) (.) ] (.) abcdefg /mob 2: <a @ 0>/ perl5 numbered captures $1
#?pugs todo
ok ('abcdefg' ~~ /$1=[ (.) (.) (.) ] (.)/) && matchcheck($/, q/mob 2: <a @ 0>/), 'perl5 numbered captures $1';
#### $1=[ (.) (.) (.) ] (.) abcdefg /mob 3: <b @ 1>/ perl5 numbered captures $1
#?pugs todo
ok ('abcdefg' ~~ /$1=[ (.) (.) (.) ] (.)/) && matchcheck($/, q/mob 3: <b @ 1>/), 'perl5 numbered captures $1';
#### $1=[ (.) (.) (.) ] (.) abcdefg /mob 4: <c @ 2>/ perl5 numbered captures $1
#?pugs todo
ok ('abcdefg' ~~ /$1=[ (.) (.) (.) ] (.)/) && matchcheck($/, q/mob 4: <c @ 2>/), 'perl5 numbered captures $1';
#### $1=[ (.) (.) (.) ] (.) abcdefg /mob 5: <d @ 3>/ perl5 numbered captures $1
#?pugs todo
ok ('abcdefg' ~~ /$1=[ (.) (.) (.) ] (.)/) && matchcheck($/, q/mob 5: <d @ 3>/), 'perl5 numbered captures $1';
#### :s $<key>=[\w+] \= $<val>=[\S+] abc = 123 /mob<key>: <abc @ 1>/ named capture
#?pugs todo
ok (' abc = 123' ~~ /:s $<key>=[\w+] \= $<val>=[\S+]/) && matchcheck($/, q/mob<key>: <abc @ 1>/), 'named capture';
#### :s $<key>=[\w+] \= $<val>=[\S+] abc = 123 /mob<val>: <123 @ 7>/ named capture
#?pugs todo
ok (' abc = 123' ~~ /:s $<key>=[\w+] \= $<val>=[\S+]/) && matchcheck($/, q/mob<val>: <123 @ 7>/), 'named capture';
#### :s (\w+) $<foo>=(\w+) (\w+) abc def ghi /mob<foo>: <def @ 4>/ mixing named and unnamed capture
#?pugs todo
ok ('abc def ghi' ~~ /:s (\w+) $<foo>=(\w+) (\w+)/) && matchcheck($/, q/mob<foo>: <def @ 4>/), 'mixing named and unnamed capture';
#### :s (\w+) $<foo>=(\w+) (\w+) abc def ghi /mob 1: <ghi @ 8>/ mixing named and unnamed capture
#?pugs todo
ok ('abc def ghi' ~~ /:s (\w+) $<foo>=(\w+) (\w+)/) && matchcheck($/, q/mob 1: <ghi @ 8>/), 'mixing named and unnamed capture';
#### <alpha> [ \- <alpha> ]? abc def ghi /mob<alpha> 0: <a @ 0>/ multiple subrule captures in same scope
#?pugs todo
ok ('abc def ghi' ~~ /<alpha> [ \- <alpha> ]?/) && matchcheck($/, q/mob<alpha> 0: <a @ 0>/), 'multiple subrule captures in same scope';
#### [(.)$0]+ bookkeeper y backreference
#?pugs todo
ok 'bookkeeper' ~~ /[ (.) $0 ]+/, 'backreference';
#### (\w+) <+ws> $0 hello hello y backreference at end of string
#?pugs todo
ok 'hello hello' ~~ /(\w+) <+ws> $0/, 'backreference at end of string';
#### [(.)$0]+ bookkeeper /mob 0 0: <o @ 1>/ backref $0
#?pugs todo
ok ('bookkeeper' ~~ /[ (.) $0 ]+/) && matchcheck($/, q/mob 0 0: <o @ 1>/), 'backref $0';
#### [(.)$0]+ bookkeeper /mob 0 1: <k @ 3>/ backref $0
#?pugs todo
ok ('bookkeeper' ~~ /[ (.) $0 ]+/) && matchcheck($/, q/mob 0 1: <k @ 3>/), 'backref $0';
#### [(.)$0]+ bookkeeper /mob 0 2: <e @ 5>/ backref $0
#?pugs todo
ok ('bookkeeper' ~~ /[ (.) $0 ]+/) && matchcheck($/, q/mob 0 2: <e @ 5>/), 'backref $0';
#### (.)*x 123x /mob: <123x @ 0>/ repeated dot capture
#?pugs todo
ok ('123x' ~~ /(.)*x/) && matchcheck($/, q/mob: <123x @ 0>/), 'repeated dot capture';
#### $<key>=<alpha> 12ab34 /mob<key>: <a @ 2>/ alias capture
#?pugs todo
ok ('12ab34' ~~ /$<key>=<alpha>/) && matchcheck($/, q/mob<key>: <a @ 2>/), 'alias capture';
#### <key=alpha> 12ab34 /mob<key>: <a @ 2>/ alias capture
#?pugs todo
ok ('12ab34' ~~ /<key=alpha>/) && matchcheck($/, q/mob<key>: <a @ 2>/), 'alias capture';
# L<S05/Extensible metasyntax (C<< <...> >>)/"A leading [ indicates">
## Enumerated character lists
#### <[c]> abcdef y character class
#?pugs todo
ok 'abcdef' ~~ /<[c]>/, 'character class';
#### <[ z ]> abc def n character class ignores ws
ok 'abc def' !~~ /<[ z ]>/, 'character class ignores ws';
#### <[dcb]>**{3} abcdef y repeated character class
#?pugs todo
#?rakudo skip 'closure repetition'
ok 'abcdef' ~~ /<[dcb]>**{3}/, 'repeated character class';
#### ^<[a]> abcdef y anchored character class
#?pugs todo
ok 'abcdef' ~~ /^<[a]>/, 'anchored character class';
# L<S05/Extensible metasyntax (C<< <...> >>)/"A leading - indicates">
#### <-[e]> abcdef y negated character class
#?pugs todo
ok 'abcdef' ~~ /<-[e]>/, 'negated character class';
#### ^<[a]>? abcdef y anchored optional character class
#?pugs todo
ok 'abcdef' ~~ /^<[a]>?/, 'anchored optional character class';
#### <-[e]>? abcdef y negated optional character class
#?pugs todo
ok 'abcdef' ~~ /<-[e]>?/, 'negated optional character class';
#### <-[dcb]>**{3} abcdef n repeated negated character class
#?rakudo skip 'nom regression'
ok 'abcdef' !~~ /<-[dcb]>**{3}/, 'repeated negated character class';
#### ^<-[e]> abcdef y anchored negated character class
#?pugs todo
ok 'abcdef' ~~ /^<-[e]>/, 'anchored negated character class';
#### ^<-[a]> abcdef n anchored negated character class
ok 'abcdef' !~~ /^<-[a]>/, 'anchored negated character class';
# L<S05/Extensible metasyntax (C<< <...> >>)/"Ranges in enumerated character classes">
#### <[b..d]> abcdef y character range
#?pugs todo
ok 'abcdef' ~~ /<[b..d]>/, 'character range';
#### <[b .. d]> c y character range ignores ws
#?pugs todo
ok 'c' ~~ /<[b .. d]>/, 'character range ignores ws';
#### <[b..d]> abxxef y character range
#?pugs todo
ok 'abxxef' ~~ /<[b..d]>/, 'character range';
#### <[b..d]> axcxef y character range
#?pugs todo
ok 'axcxef' ~~ /<[b..d]>/, 'character range';
#### <[b..d]> axxdef y character range
#?pugs todo
ok 'axxdef' ~~ /<[b..d]>/, 'character range';
#### <[b..d]> axxxef n character range
ok 'axxxef' !~~ /<[b..d]>/, 'character range';
#### <-[b..d]> abcdef y negated character range
#?pugs todo
ok 'abcdef' ~~ /<-[b..d]>/, 'negated character range';
#### <- [b..d]> abcdef y negated allows ws
#?niecza skip "space between - and [ ] is a problem?"
#?pugs todo
ok 'abcdef' ~~ /<- [b..d]>/, 'negated allows ws';
#### <-[b..d]> bbccdd n negated character range
ok 'bbccdd' !~~ /<-[b..d]>/, 'negated character range';
#### <-[d..b]> dies
#?niecza todo ""
#?pugs todo
eval_dies_ok '/<-[d..b]>/', 'illegal character range';
#?pugs todo
ok '-' ~~ /<[-]>/, 'unescaped hyphen is fine on its own';
#### <[\-]> ab-def y escaped hyphen
#?pugs todo
ok 'ab-def' ~~ /<[\-]>/, 'escaped hyphen';
#### <[\-]> abcdef n escaped hyphen
ok 'abcdef' !~~ /<[\-]>/, 'escaped hyphen';
#### <-[\-]> ---x-- y negated escaped hyphen
#?pugs todo
ok '---x--' ~~ /<-[\-]>/, 'negated escaped hyphen';
#### <-[\-]> ------ n negated escaped hyphen
ok '------' !~~ /<-[\-]>/, 'negated escaped hyphen';
#### <[\-+]> ab-def y escaped hyphen in range
#?pugs todo
ok 'ab-def' ~~ /<[\-+]>/, 'escaped hyphen in range';
#### <[\-+]> ab+def y escaped hyphen in range
#?pugs todo
ok 'ab+def' ~~ /<[\-+]>/, 'escaped hyphen in range';
#### <[\-+]> abcdef n escaped hyphen in range
ok 'abcdef' !~~ /<[\-+]>/, 'escaped hyphen in range';
#### <[+\-]> ab-def y escaped hyphen in range
#?pugs todo
ok 'ab-def' ~~ /<[+\-]>/, 'escaped hyphen in range';
#### <[+\-]> ab+def y escaped hyphen in range
#?pugs todo
ok 'ab+def' ~~ /<[+\-]>/, 'escaped hyphen in range';
#### <[+\-]> abcdef n escaped hyphen in range
ok 'abcdef' !~~ /<[+\-]>/, 'escaped hyphen in range';
#### <-[\-+]> ---x-- y negated escaped hyphen in range
#?pugs todo
ok '---x--' ~~ /<-[\-+]>/, 'negated escaped hyphen in range';
#### <-[\-+]> ------ n negated escaped hyphen in range
ok '------' !~~ /<-[\-+]>/, 'negated escaped hyphen in range';
#### <-[+\-]> ---x-- y negated escaped hyphen in range
#?pugs todo
ok '---x--' ~~ /<-[+\-]>/, 'negated escaped hyphen in range';
#### <-[+\-]> ------ n negated escaped hyphen in range
ok '------' !~~ /<-[+\-]>/, 'negated escaped hyphen in range';
#### <["\\]> \\ y escaped backslash
#?pugs todo
ok '\\' ~~ /<["\\]>/, 'escaped backslash';
#### <[\]]> ] y escaped close bracket
#?pugs todo
ok ']' ~~ /<[\]]>/, 'escaped close bracket';
#### <[\]> \\]] /parse error/ unescaped backslash (or no closing brace)
#?pugs todo
eval_dies_ok ' /<[\]>/ ', 'unescaped backslash (or no closing brace)';
#### ^\><[<]> >< y lt character class
#?pugs todo
ok '><' ~~ /^\><[<]>/, 'lt character class';
#### ^<[>]>\< >< y gt character class
#?pugs todo
ok '><' ~~ /^<[>]>\</, 'gt character class';
#### ^<[><]>**{2} >< y gt, lt character class
#?pugs todo
#?rakudo skip '**{}'
ok '><' ~~ /^<[><]>**{2}/, 'gt, lt character class';
#### ^<[<>]>**{2} >< y lt, gt character class
#?pugs todo
#?rakudo skip '**{}'
ok '><' ~~ /^<[<>]>**{2}/, 'lt, gt character class';
#### ^<-[><]> >< n not gt, lt character class
ok '><' !~~ /^<-[><]>/, 'not gt, lt character class';
#### ^<-[<>]> >< n not lt, gt character class
ok '><' !~~ /^<-[<>]>/, 'not lt, gt character class';
#### '... --- ...' ... --- ... y literal match (\\\')
#?pugs todo
ok '... --- ...' ~~ /'... --- ...'/, 'literal match (\\\')';
#### '... --- ...' ...---... n literal match (\\\')
ok '...---...' !~~ /'... --- ...'/, 'literal match (\\\')';
#### 'ab\'>cd' ab\'>cd y literal match with quote
#?pugs todo
ok 'ab\'>cd' ~~ /'ab\'>cd'/, 'literal match with quote';
#### 'ab\\yz' ab\x5cyz y literal match with backslash
#?pugs todo
ok "ab\x5cyz" ~~ /'ab\\yz'/, 'literal match with backslash';
#### 'ab"cd' ab"cd y literal match with quote
#?pugs todo
ok 'ab"cd' ~~ /'ab"cd'/, 'literal match with quote';
#### 'ab\\yz' ab\x5cyz y literal match with backslash
#?pugs todo
ok "ab\x5cyz" ~~ /'ab\\yz'/, 'literal match with backslash';
#### "... --- ..." ... --- ... y literal match (\")
#?pugs todo
ok '... --- ...' ~~ /"... --- ..."/, 'literal match (\")';
#### "... --- ..." ...---... n literal match (\")
# RT #64880
ok '...---...' !~~ /"... --- ..."/, 'literal match (\")';
#### "ab<\">cd" ab<">cd y literal match with quote
# RT #64880
#?pugs todo
ok 'ab<">cd' ~~ /"ab<\">cd"/, 'literal match with quote';
#### "ab<'>cd" ab<\'>cd y literal match with quote
# RT #64880
#?pugs todo
ok 'ab<\'>cd' ~~ /"ab<'>cd"/, 'literal match with quote';
#### "ab\\cd" ab\x5ccd y literal match with backslash
#?rakudo todo 'unknown'
#?niecza todo ''
#?pugs todo
ok "ab\x5ccd" ~~ /"ab\\cd"/, 'literal match with backslash';
#### (ab)x"$0" abxab y literal match with interpolation
#?pugs todo
ok 'abxab' ~~ /(ab)x"$0"/, 'literal match with interpolation';
#### (ab)"x$0" abxab y literal match with interpolation
#?pugs todo
ok 'abxab' ~~ /(ab)"x$0"/, 'literal match with interpolation';
# L<S05/Extensible metasyntax (C<< <...> >>)/"A leading ? indicates">
#
#### '?' ab<? y literal match with question mark
#?pugs todo
ok 'ab<?' ~~ /'?'/, 'literal match with question mark';
#### '<' ab<? y literal match with lt
#?pugs todo
ok 'ab<?' ~~ /'<'/, 'literal match with lt ';
#### '<?' ab<? y literal match with lt and question mark
#?pugs todo
ok 'ab<?' ~~ /'<?'/, 'literal match with lt and question mark';
#### '<?' ab<x? n non-matching literal match
ok 'ab<x?' !~~ /'<?'/, 'non-matching literal match ';
#### <[A..Z0..9]> abcdef n two enumerated ranges
ok 'abcdef' !~~ /<[A..Z0..9]>/, 'two enumerated ranges';
#### <[A..Z0..9]> abcDef y two enumerated ranges
#?pugs todo
ok 'abcDef' ~~ /<[A..Z0..9]>/, 'two enumerated ranges';
# L<S05/Extensible metasyntax (C<< <...> >>)/"The special named assertions">
#
## lookarounds
#### <before .d> a. abacad /mob: <ad @ 4>/ lookahead <before>
#?pugs todo
ok ('abacad' ~~ /<before .d> a./) && matchcheck($/, q/mob: <ad @ 4>/), 'lookahead <before>';
#### <before c> .... abacad n lookahead <before>
ok 'abacad' !~~ /<before c> ..../, 'lookahead <before>';
#### <before> . abcd n null <before>
#?pugs todo
eval_dies_ok "'abcd' !~~ /<before> ./", 'null <before>';
#### <!before ..b> aa aabaaa /mob: <aa @ 3>/ negated lookahead
#?pugs todo
ok ('aabaaa' ~~ /<!before ..b> aa/) && matchcheck($/, q/mob: <aa @ 3>/), 'negated lookahead';
#### <after a>b ab y lookbehind <after>
#?pugs todo
ok 'ab' ~~ /<after a>b/, 'lookbehind <after>';
#### <after a>b cb n lookbehind <after>
ok 'cb' !~~ /<after a>b/, 'lookbehind <after>';
#### <after a>b b n lookbehind <after>
ok 'b' !~~ /<after a>b/, 'lookbehind <after>';
#### <!after c>b ab y lookbehind <!after>
#?pugs todo
ok 'ab' ~~ /<!after c>b/, 'lookbehind <!after>';
#### <!after c>b cb n lookbehind <!after>
ok 'cb' !~~ /<!after c>b/, 'lookbehind <!after>';
#### <!after c>b b y lookbehind <!after>
#?pugs todo
ok 'b' ~~ /<!after c>b/, 'lookbehind <!after>';
#### <!after <[cd]>>b dbcb n lookbehind <!after>
ok 'dbcb' !~~ /<!after <[cd]>>b/, 'lookbehind <!after>';
#### <!after <[cd]>><[ab]> dbaacb y lookbehind <!after>
#?pugs todo
ok 'dbaacb' ~~ /<!after <[cd]>><[ab]>/, 'lookbehind <!after>';
#### <!after c|d>b dbcb n lookbehind <!after>
#?niecza skip "Unsuppored elements in after list"
ok 'dbcb' !~~ /<!after c|d>b/, 'lookbehind <!after>';
#### <!after c|d><[ab]> dbaacb y lookbehind <!after>
#?niecza skip "Unsuppored elements in after list"
#?pugs todo
ok 'dbaacb' ~~ /<!after c|d><[ab]>/, 'lookbehind <!after>';
#### <!after cd><[ab]> cbaccb y lookbehind <!after>
#?pugs todo
ok 'cbaccb' ~~ /<!after cd><[ab]>/, 'lookbehind <!after>';
#### $ <after ^a> a y lookbehind <after>
#?rakudo todo 'anchors and after'
#?niecza skip "Unsuppored elements in after list"
#?pugs todo
ok 'a' ~~ /$ <after ^a>/, 'lookbehind <after>';
#### <after x+>y axxbxxyc y lookbehind <after>
#?niecza skip "Unsuppored elements in after list"
#?pugs todo
ok 'axxbxxyc' ~~ /<after x+>y/, 'lookbehind <after>';
# L<S05/Extensible metasyntax (C<< <...> >>)/"A leading + may also">
#### <[a..z]>+ az y metasyntax with leading + (<+...>)
#?pugs todo
ok 'az' ~~ /<[a..z]>+/, 'metasyntax with leading + (<+...>)';
#### <+[a..z]>+ az y metasyntax with leading + (<+...>)
#?pugs todo
ok 'az' ~~ /<+[a..z]>+/, 'metasyntax with leading + (<+...>)';
#### <+alpha>+ az y metasyntax with leading + (<+...>)
#?pugs todo
ok 'az' ~~ /<+alpha>+/, 'metasyntax with leading + (<+...>)';
#### a[b} \t\n\r !"#$%&\'()*+,-./:;<=>?@[\]^`_{|}0123456789ABCDEFGHIJabcdefghij /rule error/ mismatched close
#?pugs todo
eval_dies_ok '/a[b}/', 'mismatched close';
#### c <before .d> abacad /mob: <c @ 3>/ one character and lookahead <before>
#?pugs todo
ok ('abacad' ~~ /c <before .d>/) && matchcheck($/, q/mob: <c @ 3>/), 'one character and lookahead <before>';
#### .* <before .d> abacad /mob: <abac @ 0>/ multiple characters and lookahead <before>
#?pugs todo
ok ('abacad' ~~ /.* <before .d>/) && matchcheck($/, q/mob: <abac @ 0>/), 'multiple characters and lookahead <before>';
#### .* <before .\<> abaca<d /mob: <abac @ 0>/ multiple characters and lookahead <before> with a \'<\'
#?pugs todo
ok ('abaca<d' ~~ /.* <before .\<>/) && matchcheck($/, q/mob: <abac @ 0>/), 'multiple characters and lookahead <before> with a \'<\'';
#### .* <before \<> aba<ca<d /mob: <aba<ca @ 0>/ greedy any character and lookahead <before> with a \'<\'
#?pugs todo
ok ('aba<ca<d' ~~ /.* <before \<>/) && matchcheck($/, q/mob: <aba<ca @ 0>/), 'greedy any character and lookahead <before> with a \'<\'';
#### .*? <before \<> aba<ca<d /mob: <aba @ 0>/ non-greedy any character and lookahead <before> with a \'<\'
#?pugs todo
ok ('aba<ca<d' ~~ /.*? <before \<>/) && matchcheck($/, q/mob: <aba @ 0>/), 'non-greedy any character and lookahead <before> with a \'<\'';
## Metacharacter tests
#### . a y dot (.)
#?pugs todo
ok 'a' ~~ /./, 'dot (.)';
#### . \n y dot (.)
#?pugs todo
ok '\n' ~~ /./, 'dot (.)';
#### . '' n dot (.)
ok '' !~~ /./, 'dot (.)';
#### a\s+f abcdef n whitespace (\s)
ok 'abcdef' !~~ /a\s+f/, 'whitespace (\s)';
#### ab\s+cdef ab cdef y whitespace (\s)
#?pugs todo
ok 'ab cdef' ~~ /ab\s+cdef/, 'whitespace (\s)';
#### a\S+f abcdef y not whitespace (\S)
#?pugs todo
ok 'abcdef' ~~ /a\S+f/, 'not whitespace (\S)';
#### a\S+f ab cdef n not whitespace (\S)
ok 'ab cdef' !~~ /a\S+f/, 'not whitespace (\S)';
#### ^ abc abcdef y start and end of string (^)
#?pugs todo
ok 'abcdef' ~~ /^ abc/, 'start and end of string (^)';
#### ^ abc abc\ndef y start and end of string (^)
#?pugs todo
ok "abc\ndef" ~~ /^ abc/, 'start and end of string (^)';
#### ^ abc def\nabc n start and end of string (^)
ok "def\nabc" !~~ /^ abc/, 'start and end of string (^)';
#### def \n ^ abc def\nabc n start and end of string (^)
ok "def\nabc" !~~ /def \n ^ abc/, 'start and end of string (^)';
#### def $ abcdef y start and end of string ($)
#?pugs todo
ok 'abcdef' ~~ /def $/, 'start and end of string ($)';
#### def $ abc\ndef y start and end of string ($)
#?pugs todo
ok "abc\ndef" ~~ /def $/, 'start and end of string ($)';
#### def $ def\nabc n start and end of string ($)
ok "def\nabc" !~~ /def $/, 'start and end of string ($)';
#### def $ \n abc def\nabc n start and end of string (^)
ok "def\nabc" !~~ /def $ \n abc/, 'start and end of string (^)';
#### abc \n $ abc\n y end of string ($)
#?pugs todo
ok "abc\n" ~~ /abc \n $/, 'end of string ($)';
#### abc $ abc\n n end of string ($)
ok "abc\n" !~~ /abc $/, 'end of string ($)';
#### <<def abc-def y left word boundary, beginning of word
#?pugs todo
ok 'abc-def' ~~ /<<def/, 'left word boundary, beginning of word';
#### <<bc abc-def n left word boundary, mid-word
ok 'abc-def' !~~ /<<bc/, 'left word boundary, mid-word';
#### c<< abc-def n left word boundary, end of word
ok 'abc-def' !~~ /c<</, 'left word boundary, end of word';
#### <<abc abc-def y left word boundary, BOS
#?pugs todo
ok 'abc-def' ~~ /<<abc/, 'left word boundary, BOS';
#### def<< abc-def n left word boundary, EOS
ok 'abc-def' !~~ /def<</, 'left word boundary, EOS';
#### << ------- n left word boundary, no word chars
ok '-------' !~~ /<</, 'left word boundary, no word chars';
#### >>def abc-def n right word boundary, beginning of word
ok 'abc-def' !~~ />>def/, 'right word boundary, beginning of word';
#### >>bc abc-def n right word boundary, mid-word
ok 'abc-def' !~~ />>bc/, 'right word boundary, mid-word';
#### c>> abc-def y right word boundary, end of word
#?pugs todo
ok 'abc-def' ~~ /c>>/, 'right word boundary, end of word';
#### >>abc abc-def n right word boundary, BOS
ok 'abc-def' !~~ />>abc/, 'right word boundary, BOS';
#### def>> abc-def y right word boundary, EOS
#?pugs todo
ok 'abc-def' ~~ /def>>/, 'right word boundary, EOS';
#### >> ------- n right word boundary, no word chars
ok '-------' !~~ />>/, 'right word boundary, no word chars';
#### c \n d abc\ndef y logical newline (\n)
#?pugs todo
ok "abc\ndef" ~~ /c \n d/, 'logical newline (\n)';
#### c \n d abc\rdef y logical newline matches \r
#?pugs todo
ok "abc\rdef" ~~ /c \n d/, 'logical newline matches \r';
#### c \n+ d abc\n\ndef y logical newline quantified
#?pugs todo
ok "abc\n\ndef" ~~ /c \n+ d/, 'logical newline quantified';
#### a\n+f abcdef n logical newline (\n)
ok 'abcdef' !~~ /a\n+f/, 'logical newline (\n)';
#### c \n d abc\n\rdef n logical newline matches \n\r
ok "abc\n\rdef" !~~ /c \n d/, 'logical newline matches \n\r';
#### c \n d abc\r\ndef y logical newline matches \r\n
#?pugs todo
ok "abc\r\ndef" ~~ /c \n d/, 'logical newline matches \r\n';
#### b \n c abc\ndef n logical newline (\n)
ok "abc\ndef" !~~ /b \n c/, 'logical newline (\n)';
#### \N a y not logical newline (\N)
#?pugs todo
ok 'a' ~~ /\N/, 'not logical newline (\N)';
#### a \N c abc y not logical newline (\N)
#?pugs todo
ok 'abc' ~~ /a \N c/, 'not logical newline (\N)';
#### \N '' n not logical newline (\N)
ok '' !~~ /\N/, 'not logical newline (\N)';
#### c \N d abc\ndef n not logical newline (\N)
ok "abc\ndef" !~~ /c \N d/, 'not logical newline (\N)';
#### c \N d abc\rdef n not logical newline (\N)
ok "abc\rdef" !~~ /c \N d/, 'not logical newline (\N)';
#### c \N+ d abc\n\ndef n not logical newline (\N)
ok "abc\n\ndef" !~~ /c \N+ d/, 'not logical newline (\N)';
#### a\N+f abcdef y not logical newline (\N)
#?pugs todo
ok 'abcdef' ~~ /a\N+f/, 'not logical newline (\N)';
#### c \N d abc\n\rdef n not logical newline (\N)
ok "abc\n\rdef" !~~ /c \N d/, 'not logical newline (\N)';
#### c \N d abc\r\ndef n not logical newline (\N)
ok "abc\r\ndef" !~~ /c \N d/, 'not logical newline (\N)';
#### b \N \n abc\ndef y not logical newline (\N)
#?pugs todo
ok "abc\ndef" ~~ /b \N \n/, 'not logical newline (\N)';
#### \Aabc Aabc /reserved/ retired metachars (\A)
#?pugs todo
eval_dies_ok '/\Aabc/', 'retired metachars (\A)';
#### \Aabc abc\ndef /reserved/ retired metachars (\A)
#?pugs todo
eval_dies_ok '/\Aabc/', 'retired metachars (\A)';
#### abc\Z abcZ /reserved/ retired metachars (\Z)
#?pugs todo
eval_dies_ok '/abc\Z/', 'retired metachars (\Z)';
#### abc\Z abc\ndef /reserved/ retired metachars (\Z)
#?pugs todo
eval_dies_ok '/abc\Z/', 'retired metachars (\Z)';
#### abc\z abcz /reserved/ retired metachars (\z)
#?pugs todo
eval_dies_ok '/abc\z/', 'retired metachars (\z)';
#### def\z abc\ndef /reserved|Obsolete|Unsupported/ retired metachars (\z)
#?pugs todo
eval_dies_ok '/def\z/', 'retired metachars (\z)';
#### abc # def abc#def y comments (#)
#?pugs todo
ok 'abc#def' ~~ /abc # def
/, 'comments (#)';
#### abc # xyz abc#def y comments (#)
#?pugs todo
ok 'abc#def' ~~ /abc # xyz
/, 'comments (#)';
#### abc # def \n \$ abc#def y comments (#)
#?pugs todo
ok 'abc#def' ~~ /abc # def \n \$
/, 'comments (#)';
#### abc '#' def abc#def y comments (#)
#?pugs todo
ok 'abc#def' ~~ /abc '#' def
/, 'comments (#)';
#### abc '#' xyz abc#def n comments (#)
ok 'abc#def' !~~ /abc '#' xyz
/, 'comments (#)';
#### ^ abc '#' def $ abc#def y comments (#)
#?pugs todo
ok 'abc#def' ~~ /^ abc '#' def $
/, 'comments (#)';
#### ^^ abc \n ^^ def abc\ndef y line beginnings and endings (^^)
#?pugs todo
ok "abc\ndef" ~~ /^^ abc \n ^^ def/, 'line beginnings and endings (^^)';
#### ^^ abc \n ^^ def \n ^^ abc\ndef\n n line beginnings and endings (^^)
ok "abc\ndef\n" !~~ /^^ abc \n ^^ def \n ^^/, 'line beginnings and endings (^^)';
#### ^^ \n \n y line beginnings and endings (^^)
#?pugs todo
ok "\n" ~~ /^^ \n/, 'line beginnings and endings (^^)';
#### \n ^^ \n n line beginnings and endings (^^)
ok "\n" !~~ /\n ^^/, 'line beginnings and endings (^^)';
#### abc $$ \n def $$ abc\ndef y line beginnings and endings ($$)
#?pugs todo
ok "abc\ndef" ~~ /abc $$ \n def $$/, 'line beginnings and endings ($$)';
#### abc $$ \n def $$ \n $$ abc\ndef\n n line beginnings and endings ($$)
ok "abc\ndef\n" !~~ /abc $$ \n def $$ \n $$/, 'line beginnings and endings ($$)';
#### $$ \n \n y line beginnings and endings ($$)
#?pugs todo
ok "\n" ~~ /$$ \n/, 'line beginnings and endings ($$)';
#### \n $$ \n n line beginnings and endings ($$)
ok "\n" !~~ /\n $$/, 'line beginnings and endings ($$)';
#### <[a..d]> | <[b..e]> c y alternation (|)
#?pugs todo
ok 'c' ~~ /<[a..d]> | <[b..e]>/, 'alternation (|)';
#### <[a..d]> | <[d..e]> c y alternation (|)
#?pugs todo
ok 'c' ~~ /<[a..d]> | <[d..e]>/, 'alternation (|)';
#### <[a..b]> | <[b..e]> c y alternation (|)
#?pugs todo
ok 'c' ~~ /<[a..b]> | <[b..e]>/, 'alternation (|)';
#### <[a..b]> | <[d..e]> c n alternation (|)
ok 'c' !~~ /<[a..b]> | <[d..e]>/, 'alternation (|)';
#### <[a..d]>+ | <[b..e]>+ bcd y alternation (|)
#?pugs todo
ok 'bcd' ~~ /<[a..d]>+ | <[b..e]>+/, 'alternation (|)';
#### ^ [ <[a..d]>+ | <[b..e]>+ ] $ bcd y alternation (|)
#?pugs todo
ok 'bcd' ~~ /^ [ <[a..d]>+ | <[b..e]>+ ] $/, 'alternation (|)';
#### ^ [ <[a..c]>+ | <[b..e]>+ ] $ bcd y alternation (|)
#?pugs todo
ok 'bcd' ~~ /^ [ <[a..c]>+ | <[b..e]>+ ] $/, 'alternation (|)';
#### ^ [ <[a..d]>+ | <[c..e]>+ ] $ bcd y alternation (|)
#?pugs todo
ok 'bcd' ~~ /^ [ <[a..d]>+ | <[c..e]>+ ] $/, 'alternation (|)';
#### b| bcd /rule error/ alternation (|) - null right arg illegal
#?pugs todo
eval_dies_ok '/b|/', 'alternation (|) - null right arg illegal';
#### |b bcd y alternation (|) - null left arg ignored
#?pugs todo
ok 'bcd' ~~ /|b/, 'alternation (|) - null left arg ignored';
#### | bcd /rule error/ alternation (|) - null both args illegal
#?pugs todo
eval_dies_ok '/|/', 'alternation (|) - null both args illegal';
#### \| | y alternation (|) - literal must be escaped
#?pugs todo
ok '|' ~~ /\|/, 'alternation (|) - literal must be escaped';
#### | | /rule error/ alternation (|) - literal must be escaped
#?pugs todo
eval_dies_ok '/|/', 'alternation (|) - literal must be escaped';
#### <[a..d]> & <[b..e]> c y conjunction (&)
#?niecza todo ''
#?pugs todo
ok 'c' ~~ /<[a..d]> & <[b..e]>/, 'conjunction (&)';
#### <[a..d]> & <[d..e]> c n conjunction (&)
ok 'c' !~~ /<[a..d]> & <[d..e]>/, 'conjunction (&)';
#### <[a..b]> & <[b..e]> c n conjunction (&)
ok 'c' !~~ /<[a..b]> & <[b..e]>/, 'conjunction (&)';
#### <[a..b]> & <[d..e]> c n conjunction (&)
ok 'c' !~~ /<[a..b]> & <[d..e]>/, 'conjunction (&)';
#### <[a..d]>+ & <[b..e]>+ bcd y conjunction (&)
#?pugs todo
ok 'bcd' ~~ /<[a..d]>+ & <[b..e]>+/, 'conjunction (&)';
#### ^ [ <[a..d]>+ & <[b..e]>+ ] $ bcd y conjunction (&)
#?pugs todo
ok 'bcd' ~~ /^ [ <[a..d]>+ & <[b..e]>+ ] $/, 'conjunction (&)';
#### <[a..c]>+ & <[b..e]>+ bcd y conjunction (&)
#?pugs todo
ok 'bcd' ~~ /<[a..c]>+ & <[b..e]>+/, 'conjunction (&)';
#### <[a..d]>+ & <[c..e]>+ bcd y conjunction (&)
#?pugs todo
ok 'bcd' ~~ /<[a..d]>+ & <[c..e]>+/, 'conjunction (&)';
#### b& bcd /rule error/ conjunction (&) - null right arg illegal
#?pugs todo
eval_dies_ok '/b&/', 'conjunction (&) - null right arg illegal';
#### &b bcd /rule error/ conjunction (&) - null left arg illegal
#?rakudo todo 'infix:<S&>'
#?niecza todo ''