I don't know how to modify the:
sed -r 's,.*(http://%5B%5E "$]+).*,<a href="\1">\1</a>,'
command, to not just: $ echo "test string http://somewhere.uk/ test" | sed -r 's,.*(http://%5B%5E "$]+).*,<a href="\1">\1</a>,' <a href="http://somewhere.uk/">http://somewhere.uk/</a>
rather output this: test string <a href="http://somewhere.uk/">http://somewhere.uk/</a> test
can some perl/bash gods help me? :)
At 18:07 on 07 Mar 2010, Vadkan Jozsef wrote:
I don't know how to modify the:
sed -r 's,.*(http://%5B%5E "$]+).*,<a href="\1">\1</a>,'
command, to not just: $ echo "test string http://somewhere.uk/ test" | sed -r 's,.*(http://%5B%5E "$]+).*,<a href="\1">\1</a>,' <a href="http://somewhere.uk/">http://somewhere.uk/</a>
rather output this: test string <a href="http://somewhere.uk/">http://somewhere.uk/</a> test
$ echo "test string http://somewhere.uk/ test" | \ sed -r 's,(.*)(http://%5B%5E%5C%22$ ]+)(.*),\1<a href="\2">\2</a>\3,'