I want to replace src='hello'
with src='foobar'
with sed
.
I believe it is with this command but it doesnt seem to work:
sed -i "s/(src=').*'/src='foobar'/g" index.php
I want to replace src='hello'
with src='foobar'
with sed
.
I believe it is with this command but it doesnt seem to work:
sed -i "s/(src=').*'/src='foobar'/g" index.php
Anyway, I figured it out. The following is the input command.
$ sed -i -E "s/(src=').*(')/src='foobar'/g" index.php
This would replace:
<pre>
<img src='hello' />
<img src='what' />
</pre>
With:
<pre>
<img src='foobar' />
<img src='foobar' />
</pre>