From: Frazier, Joe Jr <Joe.Frazier@PeopleClick.com> - 2001-03-30 12:04:12
if ("LST" =3D~ /[qt|et1|et2|si|rlt]/i) means the same as
if ("LST" =3D~ /[qtet1et2sirlt|]/i); The pipe(|) character has no =
meaning INSIDED [bracketed] regex, so basically, this regex matches any
character in the list if it is anywhere in the string to be searched.
As max stated, putting () around the characters would be the correct way
to do the regex. That is, unless you always want the if statement to
Also remember that "|" is interpreted as a literal within square
brackets, so if you write `[fee|fie|foe]' you're really only
Joe Frazier, Jr
Technical Support Engineer
> -----Original Message-----
> From: Max Kozlov [mailto:max_perl@...]
> Sent: Friday, March 30, 2001 6:05 AM
> To: Eoin_Butler@...
> Subject: Re: [perl-win32-gui-users] desktop
> Hello Eoin,
> Friday, March 30, 2001, you wrote:
> Edc> if ("LST" =3D~ /[qt|et1|et2|si|rlt]/i)
> Edc> Can Anybody Tell Me Why the expression above is matching.
> Edc> According to everything I've read it shouldn't.=20
> Edc> I'm going soft again ....
> Edc> Any help would be greatly appriciated
> if ("LST" =3D~ /(qt|et1|et2|si|rlt)/i)
> feel the difference ;-)
> Best regards,
> Max mailto:max_perl@...
> Perl-Win32-GUI-Users mailing list