MySQL Regex – Select Any Couple of Digits Except ’00’

MySQLregex

I just found out that mysql doesn't support full regular expressions syntax. I have to select any couple of digits except of 00 (so, 11, 54, 02, are ok, but not 00).

Normally I would use a negative lookahead like this:

(?!00)[0-9]{2}

But in mysql it is not supported. So how could I do it?

Best Answer

Direct solution:

(0[1-9])|([1-9][0-9])

It is simple enough for do not look for shortening or another optimization, I think.