#!/usr/bin/perl use strict; use warnings; my $str = "This is a string with a URL like http://www.example.com in it"; print "$str\n"; $str =~ s/http\S+/ /ig; print "$str\n"; __END__ This is a string with a URL like http://www.example.com in it This is a string with a URL like in it