Forum Moderators: open

Message Too Old, No Replies

Issue with REGEXP mysql query.

         

8kobe

8:29 pm on Dec 13, 2007 (gmt 0)

10+ Year Member



SELECT * from card_baseball where complete_name REGEXP '[[:<:]][[:upper:]]{2,}[[:>:]]' LIMIT 20;

I have a column in my tables called complete_name. complete name has in it some descriptive upper case letter codes that I would like to seperate from them. Examples would be

John Doe AB
John Doe CD
John doe GR
Joe Shom HTY
Bob Doles GTRY /12000

They are always 2+ Capital letters and always surround be spaces or at the end of the line (They are not always at the very end of the lines seen by last example).

When I do the above query i return everything (from first 20), what am I doing wrong?

8kobe

8:32 pm on Dec 13, 2007 (gmt 0)

10+ Year Member



Never mind, I noticed in order to use [[:upper:]] correctly Binary searching is required.