perl -le '$foo = "blah blah http://www.foo.com/ blah blah"; $foo =~ s/http\S+/ /ig; print $foo' blah blah blah blah