wireshark
wireshark

Reputation: 1633

How to use regex in MySQL?

I want to filter out those with field not like '%_[0-9]+' ,

but it turns out that MySQL doesn't take it as regex,

is that possible in MySQL?

Upvotes: 17

Views: 8159

Answers (1)

zerkms
zerkms

Reputation: 255115

That happens because of LIKE is not supposed to accept regular expression as a parameter. There is REGEXP for such things

WHERE field NOT REGEXP '%_[0-9]+'

Upvotes: 19

Related Questions