MySQL regular expressions

Just found out MySQL can also use regular expression in the WHERE and I used it to match all valid URL’s and to find invalid URL’s.

To find all rows that match the regular expression

SELECT * FROM campaign
WHERE url REGEXP "^((https?|ftp)://|(www|ftp)\.)[a-z0-9-]+(\.[a-z0-9-]+)+([/?].*)?$";

To find all rows that not match the regular expression

SELECT * FROM campaign 
WHERE url NOT REGEXP "^((https?|ftp)://|(www|ftp)\.)[a-z0-9-]+(\.[a-z0-9-]+)+([/?].*)?$";