Created
April 26, 2017 01:21
-
-
Save samcv/258a705b46e5085c2ce76808552b209a 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
#!/usr/bin/env perl6 | |
my $json = Q:to/END/; | |
{ | |
"name" : "Math::FourierTransform", | |
"source-url": "git://github.com/MattOates/Math--FourierTransform.git", | |
"author": "Matt Oates", | |
"source-type": "git", | |
"depends": [ | |
], | |
"provides": { | |
"Math::FourierTransform": "lib/Math/FourierTransform.pm6" | |
}, | |
"version": "0.0.1", | |
"description": "Discrete Fourier Transform implementation." | |
} | |
END | |
my $nl = "\n"; | |
my $license = "Artistic-2.0"; | |
say $json ~~ s/ ^^ | |
$<leading>=(\s*) | |
$<whole>=( '"name"' $<mid>=(\s*) ':' $<midafter>=(\s*) '"'.*? $$) | |
/$<leading>$<whole>$nl$<leading>\"license\"$<mid>\:$<midafter>\"$license\"/; | |
say $json; | |
#say $<leading>; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment