How can I match a field in the MySql-Database with a regular expression that should be null or a defined string? In Javascript the expression would look like this (and in JS it works) /(.{0}|^ADO$)/
It might be clearest to use IFNULL so you can explictly indicate how you want to handle NULLs (I'm always looking for ways to make code easier to understand, rather than more tricksy). Perhaps something like this:
SELECT * from table where IFNULL(field, '') REGEXP 'whatever';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With