Created
December 14, 2011 04:14
-
-
Save qiuhw/1475234 to your computer and use it in GitHub Desktop.
Regex bug in Rakudo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The following test file | |
#=============================================== | |
use Test; | |
ok 'aa-aa' ~~ / .+ '-' .+/; | |
ok 'aa-aa' ~~ / .+ '-' (.+)/; | |
ok 'aa-aa' ~~ / (.+) '-' .+/; | |
ok 'aa-aa' ~~ / (.+) '-' (.+)/; | |
ok 'aa-aa' ~~ / .+? '-' .+/; | |
ok 'aa-aa' ~~ / .+? '-' (.+)/; | |
ok 'aa-aa' ~~ / (.+?) '-' .+/; | |
ok 'aa-aa' ~~ / (.+?) '-' (.+)/; | |
ok '/aa-aa' ~~ / '/' .+? '-' .+/; | |
ok '/aa-aa' ~~ / '/' .+? '-' (.+)/; | |
ok '/aa-aa' ~~ / '/' (.+?) '-' .+/; | |
ok '/aa-aa' ~~ / '/' (.+?) '-' (.+)/; | |
done; | |
#======================================= | |
generates the output as follows: | |
ok 1 - | |
ok 2 - | |
not ok 3 - | |
not ok 4 - | |
ok 5 - | |
ok 6 - | |
ok 7 - | |
ok 8 - | |
ok 9 - | |
ok 10 - | |
not ok 11 - | |
not ok 12 - | |
1..12 | |
# Looks like you failed 4 tests of 12 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment