I have the following mysql regex:
REGEXP '-v[0-9]{1,2}'
Which catches -v01
and -v1
and -v03
and -v97
, I want to add a dot .
at the end of it:
-v01.
and -v1.
and -v03.
and -v97.
so that it only catches version number followed by the dot.
I tried .
but that did not seem to work – even though it should.
What am I missing?
4
Answers
fiddle
You can do it using this regex :
This working for mysql 8.
on older mysql you can’t use +? and *? It throw
repetition-operator operand invalid
The First is,
The Second is,
The first code Regex101
The second code Regex101
This is a working solution for all mysql versions.
Seems you are working with an older version of mysql.