Friday, January 23, 2009

Regular Expressions in MySQL

Do you need to limit your SQL results and LIKE '%foo%' isn't giving you a narrow enough result list?

Well, I'm sure you know how to narrow down those SQL results with a regex! So all there is to it is the REGEXP operator! Yay!

Example:

SELECT * FROM table WHERE column REGEXP 'data[0-9]';


You get the point; now enjoy! Cheers!

No comments: