SED Question: Search and Replace start of line to matching pattern

Hi guys,

got a problem here with sed on the command line.

If i have a string as below:

online     xx:wer:xcv:  sdf:/asdf/http:https-asdfd

How can i match the pattern "http:" and replace the start of the string to the pattern with null?

I tried the following but it doesn't work:

 cat /tmp/test | sed 's/*http\://g'

TIA

Lose the cat. Let sed open the file - try this:

sed 's/^.*http\://g'  filename > newfilename

You did some mistake in your code. Because in the regular expression you are not match correctly. The following code will give the correct answer

cat filename |   sed 's/.*http\://g'

or use the following code

 
 sed 's/.*http\://g' filename 

Thanks alot Jim.