Created
April 25, 2015 14:01
-
-
Save Tux/f6a9b0a268abb223b24e to your computer and use it in GitHub Desktop.
Regex severely broke!
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
$ p6 -v | |
This is perl6 version 2015.03-349-g5cfddf5 built on MoarVM version 2015.03-140-g6c8bd19 | |
$ p6 -e'my$s=",";my$q=q{"};my$e=q{"};.perl.say for q{hello,","," ",world,"!"}.split(rx{\r\n|\r|\n|$s|$q|$e},:all).map: {if $_ ~~ Str { $_ if .chars;}else{.Str if .Bool;}}' | |
"hello" | |
"," | |
"\"" | |
"," | |
"\"" | |
"," | |
"\"" | |
" " | |
"\"" | |
"," | |
"world" | |
"," | |
"\"" | |
"!" | |
"\"" | |
$ p6 -v | |
This is perl6 version 2015.04-51-g0c197cd built on MoarVM version 2015.04-20-g10f3ad3 | |
$ p6 -e'my$s=",";my$q=q{"};my$e=q{"};.perl.say for q{hello,","," ",world,"!"}.split(rx{\r\n|\r|\n|$s|$q|$e},:all).map: {if $_ ~~ Str { $_ if .chars;}else{.Str if .Bool;}}' | |
"hello ," | |
" \"" | |
" ," | |
" \"" | |
" ," | |
" \"" | |
" \"" | |
" ," | |
"world ," | |
" \"" | |
"! \"" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment