Skip to content

Instantly share code, notes, and snippets.

@Tux
Created April 25, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tux/f6a9b0a268abb223b24e to your computer and use it in GitHub Desktop.
Save Tux/f6a9b0a268abb223b24e to your computer and use it in GitHub Desktop.
Regex severely broke!
$ 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