Skip to content

Instantly share code, notes, and snippets.

@denitram
Last active August 28, 2016 22:47
Show Gist options
  • Save denitram/6677043 to your computer and use it in GitHub Desktop.
Save denitram/6677043 to your computer and use it in GitHub Desktop.
8 Regular Expressions You Should Know
http://net.tutsplus.com/tutorials/other/8-regular-expressions-you-should-know/
# insert a new line with '<null\>' as content every 6th line between lines 100 and 2000
100,2000s/\v(.*\n){6}/\0\<null\/\>\r/g
see http://stackoverflow.com/questions/10413906/how-to-add-a-line-after-every-few-lines-in-vim
# delete blank lines
:g/^$/d
# join all lines
:1,$join
# grep just ONE word
grep -ioh "\w*WORD\w*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment