I m trying to do some batch replacement for/with a fairly complex pattern
So far I find the pattern as:
find ( -name *.php -o -name *.html ) -exec grep -i -n hello {} +
The string I want to replace is currently as follow:
<img src="/some/path/to/somewhere/hello" />
where the path for the image varies but always contain the sub-string hello at the end
I would like to grab the path and perform a replacement as follow:
<img src="<?php myfunction( (/some/path/to/somewhere/) ); ?>" />
What would a good way to perform this?
Any help will be appreciate it.