The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 09-29-2006
muxman muxman is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 5
how do I negate a sed match

I have a text file that has links in it.

I can write a match for sed to replace the link with anything.

For example:
Code:
http://www.google.com 
becomes
XxX
But what I'm after is not to replace the link with something but to remove everything else and just leave the link. I want a negative match. So that everything that matches is left alone but all non-matching text is removed.

Any ideas?