List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:February 2 2001 1:09am
Subject:Re: Incorrect data returned by REGEXP or RLIKE
View as plain text  
At 11:57 AM +0000 2/1/01, Dave Cave wrote:
>I have been running the 'menagerie' tutorial from the mySQL manual and sure
>enough SELECT * FROM pet WHERE name REGEXP "[wW]"; returns Claws, Bowser and
>Whistler. However, when I run SELECT * FROM pet WHERE name REGEXP "[w]"; (or
>[W]) I still get the same results. Is there something I need to set to make
>the expression case sensitive?

Ah, argh.  This happens because REGEXP was changed to be case insensitive
as of MySQL 3.23.4.  You can use the BINARY keyword to make the comparison
case sensitive:

SELECT * FROM pet WHERE name REGEXP BINARY "[w]";


Thanks for pointing this out.  We'll update the manual pronto.

-- 
Paul DuBois, paul@stripped
Thread
Incorrect data returned by REGEXP or RLIKEDave Cave1 Feb
  • Re: Incorrect data returned by REGEXP or RLIKEGerald L. Clark1 Feb
  • Re: Incorrect data returned by REGEXP or RLIKEPaul DuBois2 Feb
    • Re: Incorrect data returned by REGEXP or RLIKEJeremy D. Zawodny2 Feb
      • Re: Incorrect data returned by REGEXP or RLIKEPaul DuBois2 Feb