At 2:53 PM +0800 1999-12-13, Santosh Shotemba wrote:
>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