How can I write a regex which will replace any file name, with it's folder path, but wouldn't match url? and wouldn't match in url? For example it should match:
/images/something.png
content/scripts/myscript.js
image.gif
/1.jpg
But should not match:
http://www.google.com/images/something.png
www.google.com/scripts/myscript.js
http://site.com/?img=/image.png
http://site.com/?img=/scripts/somescript.js
Thanks...