Last active
August 28, 2016 22:47
-
-
Save denitram/6677043 to your computer and use it in GitHub Desktop.
8 Regular Expressions You Should Know
This file contains hidden or 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
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