I'm not familiar with regex in MySQL.
For testing if the value exists in the string you can use
mysql> SELECT FIND_IN_SET(15, '1,2,15,4,5,6');
+---------------------------------+
| FIND_IN_SET(15, '1,2,15,4,5,6') |
+---------------------------------+
| 3 |
+---------------------------------+
1 row in set (0.00 sec)
and test it for greater than 0 (0 is returned if no match is found).
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