On Sep 29, 10:21 pm, [EMAIL PROTECTED] (Loke) wrote: > On Sep 29, 11:03 am, [EMAIL PROTECTED] (Paul Lalli) wrote:> On Sep 28, > 3:18 pm, [EMAIL PROTECTED] (Loke) wrote: > > > > Hi. I am trying to filter strings which do not have :// in them, I am > > > able to find strings with :// but I want to do the exact opposite. > > > > regex to match : /(.*:\/\/.*)/i > > > > I tried /(.*(?!:\/\/).*)/i but it does not work. > > > if ($string !~ m{://}) { ... } > > > Paul Lalli > > Paul: > Thanks for the help, but I think I have not put my problem correctly. > I want to match and replace only strings which do not have :// in > them.
Well then, pretty obviously, the "..." in my post would in your case be a s/// operation, wouldn't it? What's the issue here? If the string does not match ://, then do a search-and-replace. > That means I would need to use s/// and that is why I need to > negate the match itself. This is gobbeldy-gook that makes no sense. You cannot "negate the match itself". In a search-and-replace, you tell Perl *what* you want to match and replace it with. You've not done that. Paul Lalli -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/