----- Original Message -----
From: "Jeff 'japhy' Pinyan" <[EMAIL PROTECTED]>
To: "Beau E. Cox" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, June 25, 2003 8:45 AM
Subject: Re: Regex problem
> On Jun 25, Beau E. Cox said:
>
> >my $string = 'I love c++';
> >my $compare = 'some compare string';
> >if ($compare =~ /$string/) {
> > print "$compare contains $string\n";
> >} else {
> > print "$compare does not contain $string\n";
> >}
>
> Why don't you want to use
>
> if (index($compare, $string) > -1) { ... }
>
> There's no need to use the regex engine if you're absolutely NOT using
> patterns.
>
Thanks Japhy -
Sometimes you get in a rut (in my case I seem to
have regexs on my brain) and don't take the time to
think of the better way to get something done. Yes,
your solution is GOOD - I'll use it.
Aloha => Beau;
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]