[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: perl/bash question - html link out of text



On Sunday 07 March 2010 11:07:56 Vadkan Jozsef wrote:
> I don't know how to modify the:
> 
> sed -r 's,.*(http://[^ \"$]+).*,<a href=\"\1\">\1</a>,'
> 
> command, to not just:
> $ echo "test string http://somewhere.uk/ test" | sed -r 's,.*(http://[^
> \"$]+).*,<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

sed -r 's,(http://[^ \"$]+),<a href=\"\1\">\1</a>,'

maybe?
-- 
Boyd Stephen Smith Jr.           	 ,= ,-_-. =.
bss@iguanasuicide.net            	((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy 	 `-'(. .)`-'
http://iguanasuicide.net/        	     \_/

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: