Forum Moderators: open

Message Too Old, No Replies

MySQL regex

         

rfontaine

11:49 pm on Dec 29, 2005 (gmt 0)

10+ Year Member



I am terrible at regular expressions - I am trying to figure out how to query for records where the title has only the characters a-z(both upper and lower case) and underscores like

a-zA-Z_

If the title has anything other than these characters then don't select it.

Something like:

select id from tbl_widgets where title = regex....

What would be the best way?

Thank you in advance

Rebrandt

9:36 am on Dec 30, 2005 (gmt 0)

10+ Year Member



something like this:

SELECT * FROM table WHERE title REGEXP "/[a-zA-Z_]/"