I got the following error in mysql:
Got error 'invalid repetition count(s)' from regexp
My query is:
SELECT * FROM table WHERE some_text_field REGEXP"[A-Za-z0-9]{256}"
But when I replace REGEXP"[A-Za-z0-9]{256}"
with REGEXP"[A-Za-z0-9]{255}"
and below there is no error.
Is there any character limitation in REGEXP? Why does it not work when I use 256 or above but works when I replace it with 255 or below?
I looked into this, Mysql throwing exception on Regex, but it is not very informative on why the error is occurring.
As documented under Regular Expressions:
To be more precise,
a{n}
matches exactlyn
instances ofa
.a{n,}
matchesn
or more instances ofa
.a{m,n}
matchesm
throughn
instances ofa
, inclusive.
m
andn
must be in the range from0
toRE_DUP_MAX
(default 255), inclusive. If bothm
andn
are given,m
must be less than or equal ton
.
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