mysql RLIKE '[[:<:]]WA[[:>:]]'

kingjely
kingjely used Ask the Experts™
on
what is the difference between

select * from customers
where address RLIKE 'WA'

and

select * from customers
where address RLIKE '[[:<:]]WA[[:>:]]'
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
it means that you look for the word as written, ex :

this is WA in my example : --> returns 1
this isWA in my example : --> returns 0

RLIKE 'WA' will return 1 in both examples

Author

Commented:
does it match exact, even with the case?
WA, Wa

Commented:
Yes it does, you can test with :

SELECT 'Wa' RLIKE '[[:<:]]WA[[:>:]]';

Author

Commented:
Thanks,
I shouldn't've been so lazy and tesed myself ;)

Commented:
everytime you have a doubt, test yourself on mysql client you'll avoid some points loss ;-)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial