Created
November 6, 2015 13:13
-
-
Save Tux/0bf175a73e713b2e43e9 to your computer and use it in GitHub Desktop.
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
use v6; | |
# string to parse | |
my Str $str = ',"I said, ""Hi!""",'; | |
# three alternatives for eol, separator, and quote | |
# as escape is identical to quote, I do not need to repeat | |
my @re = "\r\n", "\r", "\n", ",", "\"", Str; | |
my @chunks = $str.split(@re, :k, :skip-empty); | |
dd $str; | |
dd @re; | |
dd @chunks; | |
=> | |
Can only :k, :kv, :p when using multiple Cool needles | |
in block <unit> at split.pl:10 | |
due to the trailing Str in @re |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment