Regex to get part of image url (sublime text 3)

I have a XML database containing several thousand positions. Text + html tags (images and links). I need a regex for Sublime Text 3 to replace a portion of the every image url (everything before file name).

For example, I have this:

<img src="/images/fanart/bigfana2121rt/215627676.jpg">

and

<img src="/images/screenshots/goodlooking/tret/215627676.gif">

And I need to get this:

/images/fanart/bigfana2121rt/

and this:

/images/screenshots/goodlooking/tret/

Thank you.


Source: regex

Leave a Reply