mysql - SQL match on letter and number arrangement -


is possible write sql statement finds rows match specific arrangement of letters/numbers?

i.e. select mycol mytable mycol='<letter><letter><number>'

should return 12x , 34y not 123x or 34yy

i using mysql.

i haven't got mysql on machine test think

select mycol  mytable  mycol regexp '^[0-9][0-9][a-z]$' 

should it. ^ anchor start of string, $ end of string , rest should self explanatory.

looks use regexp '^[[:digit:]][[:digit:]][[:alpha:]]$' untested , going off docs.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -