Re: Checking for multiple instances of a string

2002-11-23 Thread dan
$retest = substr($linewithsubjectin,3); if ($retest ne "Re:") { # hasn't got Re: in } else { # has got Re: in } should work. dan "Gavin Laking" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hi folks,

RE: Checking for multiple instances of a string

2002-11-23 Thread Beau E. Cox
Hi- Try: #!/usr/bin/perl use strict; use warnings; my $subject = "Re: Re: Re: Re: Howdy"; print "origonal: $subject\n"; $subject =~ s/(Re:\s)+/$1/g; print "final: $subject\n"; (tested) Dress it up as you wish, i.e. .../gi; is a cassless match, etc. Aloha =>