SELECT 'aXbc' REGEXP '^[^a-dXYZ]+$'; (3) : Not « Regular Expressions « MySQL Tutorial






mysql>
mysql>
mysql> SELECT 'aXbc' REGEXP '^[^a-dXYZ]+$';
+------------------------------+
| 'aXbc' REGEXP '^[^a-dXYZ]+$' |
+------------------------------+
|                            0 |
+------------------------------+
1 row in set (0.02 sec)








24.7.Not
24.7.1.Matches any character that is (or is not, if ^ is used) either a, b, c, d or X: [a-dX], [^a-dX]
24.7.2.SELECT 'aXbc' REGEXP '^[a-dXYZ]$';
24.7.3.SELECT 'aXbc' REGEXP '^[a-dXYZ]+$'; (2)
24.7.4.SELECT 'aXbc' REGEXP '^[^a-dXYZ]+$'; (3)
24.7.5.SELECT 'abcdeX' REGEXP '^[^a-dXYZ]+$';
24.7.6.SELECT 'abcda' REGEXP '^[^a-dXYZ]+$';