Skip to content

Instantly share code, notes, and snippets.

@jlapier
Created September 24, 2011 18:19
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 jlapier/1239663 to your computer and use it in GitHub Desktop.
Save jlapier/1239663 to your computer and use it in GitHub Desktop.
grep for double words in text
# I use this to find double words in a text file
# for example, "Give it to the kid." gets typoed as "Give it the the kid."
# this regex will find "the the" and help me track down those double word typos
egrep '(\b\w+)\s\1\b' *.txt --color -n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment