sed append to string

I am trying to replace in multiple files every instance of text that begins with http and add hyperlink characters to it. I can get it to work with the following:

sed -e "s/http*.*/<a href=\"&\">&<\/a>/g" *

as long as the http text is at the end of the file. I need it to stop at the end of the text which will end with a html, sh or cgi.

Example text file before:

If you wish to view your options, go to http://20.1.1.1/myoptions.cgi or go to http://10.1.1.1/nextoptions.sh

Example of after:

If you wish to view your options, go to <a href="http://20.1.1.1/myoptions.cgi">http://20.1.1.1/myoptions.cgi</a> or go to <a href="http://10.1.1.1/nextoptions.sh">http://10.1.1.1/nextoptions.sh</a> 
sed 's|http[^ ]*|<a href="&">&</a>|g' input
[ctsgnb@shell ~]$ echo "If you wish to view your options, go to http://20.1.1.1/myoptions.cgi or go to http://10.1.1.1/nextoptions.sh" | sed 's|http[^ ]*|<a href="&">&</a>|g'
If you wish to view your options, go to <a href="http://20.1.1.1/myoptions.cgi">http://20.1.1.1/myoptions.cgi</a> or go to <a href="http://10.1.1.1/nextoptions.sh">http://10.1.1.1/nextoptions.sh</a>
[ctsgnb@shell ~]$
1 Like

Perfect! Thank you!