Tag Archives: vim

Vim Search and Replace: Grabbing Image URLs from HTML source code

The following is a quick and dirty way of pulling a lot of URLs out of a given pages source code, using two commands in vim, my new favourite text editor. So, right to the point!

:v/jpg/d
:%s/^.*src="\(http:.\{-}jpg\)".*/\1/g

Try it out right now on the source code of Imgur’s /r/ScarlettJohansson’s page

Continue reading Vim Search and Replace: Grabbing Image URLs from HTML source code