Skip to content

Instantly share code, notes, and snippets.

@neelsmith
Created October 25, 2013 10:20
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 neelsmith/7152548 to your computer and use it in GitHub Desktop.
Save neelsmith/7152548 to your computer and use it in GitHub Desktop.
critic markup perl: accept markup in stdin
while (<STDIN>) {
my $currLine = $_;
# accept deletions:
$currLine =~ s#{--[^\-]+--}##g;
# accept additions:
$currLine =~ s#{\+\+([^+]*)\+\+}#$1#g;
# accept changes:
$currLine =~ s#{~~[^~]+~>([^~]+)~~}#$1#;
print $currLine;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment