Created
May 30, 2016 22:48
Star
You must be signed in to star a gist
Perl6: Capture windows newline with regex
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; | |
| use experimental :pack; | |
| my $fn = 'in.txt'; | |
| my $fh = open $fn, chomp => False; # I've also tried :bin | |
| for $fh.lines -> $line { | |
| if $line ~~ /(<[\r\n]>**1..2)/ { | |
| $0.Str.encode('UTF-8').unpack("H*").say; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment