Skip to content

Instantly share code, notes, and snippets.

@hauleth
Created February 2, 2014 21: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 hauleth/8775155 to your computer and use it in GitHub Desktop.
Save hauleth/8775155 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use warnings;
while(<>) {
s/((\b\w+\b)(\s+\2\b)+)/[$1]/ig;
print "$_";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment