List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:December 13 1999 1:36pm
Subject:Re: Regular expression in mysql.
View as plain text  
At 2:53 PM +0800 1999-12-13, Santosh Shotemba wrote:
>Hi folks,
>Just wondering if this is the right syntax to use regular expressin in sql
>query for mysql. For instance, "Select field1,field2,field3 from tablename
>where field1 REGEX ['$field1']" where ['$field1'] can contain any valid
>field1 values(color types in this case) in this form :
>red|blue|green|orange|black. Sure, I could have used "Select
>field1,field2,field3 from tablename where field1 in
>(red,blue,green,orange,black)" as someone suggested to me last night, but
>just want to play around with regular expressions.

You'll save yourself a lot of trial and error if you check the
syntax for REGEX in Chapter 7 of the MySQL manual.

Paul DuBois, paul@stripped
Regular expression in mysql.Santosh Shotemba13 Dec
  • Re: Regular expression in mysql.Paul DuBois13 Dec