if ("LST" =~ /[qt|et1|et2|si|rlt]/i) means the same as if ("LST" =~ /[qtet1et2sirlt|]/i); The pipe(|) character has no special 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 return false.
>From perlre: Also remember that "|" is interpreted as a literal within square brackets, so if you write `[fee|fie|foe]' you're really only matching `[feio|]'. Joe Frazier, Jr Technical Support Engineer Peopleclick.com 800-841-2365 [EMAIL PROTECTED] > -----Original Message----- > From: Max Kozlov [mailto:[EMAIL PROTECTED] > Sent: Friday, March 30, 2001 6:05 AM > To: [EMAIL PROTECTED] > Subject: Re[2]: [perl-win32-gui-users] desktop > > > Hello Eoin, > > Friday, March 30, 2001, you wrote: > > Edc> if ("LST" =~ /[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. > Edc> I'm going soft again .... > Edc> Any help would be greatly appriciated > > if ("LST" =~ /(qt|et1|et2|si|rlt)/i) > > feel the difference ;-) > > Best regards, > Max mailto:[EMAIL PROTECTED] > > > > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Perl-Win32-GUI-Users@lists.sourceforge.net > http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users >