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


i have xml database containing several thousand positions. text + html tags (images , links). need regex sublime text 3 replace portion of every image url (everything before file name).

for example, have this:

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

and

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

and need this:

/images/fanart/bigfana2121rt/ 

and this:

/images/screenshots/goodlooking/tret/ 

thank you.

regex:

<img\b[^>]*\bsrc="([^"]*\/)[^\/"]*"[^<>]*> 

replacement string:

\1 

demo


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -