regex - Regular Expression: Insert between two characters -


my regular expression skills aren't great. i'm using sublime text , want replace between first 2 slashes (/) different name. (this url flattening project.)

img src="/testing/graphics/real.gif" 

you can replace result of following regex :

^/([^/]*)/(.*) 

with :

/your_word/\2 #or /your_word/$2 languages  

for example in python can :

>>> re.sub(r'^/([^/]*)/(.*)',r'/-------/\2',"/testing/graphics/real.gif") '/-------/graphics/real.gif' 

Comments

Popular posts from this blog

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

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

Website Login Issue developed in magento -