PDA

View Full Version : MySQL REGEX Query


BamaStangGuy
28 Oct 2007, 08:49
I am running this query:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



With the goal of retrieving every tag that starts with 0-9. I have one tag in there right now that starts with a 3, '3 doors down'.

However the above query does not return any results. Is that the correct format and if so what would be causing it to return nothing at all?

Marco van Herwaarden
28 Oct 2007, 13:03
'^[0-9]'

This means that the data should start with a single digit number and nothing after that.

try:

'^[0-9].*'

BamaStangGuy
28 Oct 2007, 19:50
I figured it out. I had a misspelling lol.

Thanks for the help though, I did need to adjust the regex.