Mysql exception exception in Regex

It works:

mysql> SELECT '123456789' REGEXP '.{3}';#1

mysql> SELECT '123456789' REGEXP '.{10}';#2

but not this:

mysql> SELECT * FROM mymodel WHERE some_text_field REGEXP '.{100}';#3

throw exception: ERROR 1139 (42000): Got the error "invalid number of retries" from regexp

0
source share
1 answer

This means that there is no line with a length of 100 characters in this field.
You can try this instead if you just want to check this condition:

SELECT * FROM mymodel WHERE LENGTH(some_text_field) = 100 ;
+1
source

All Articles