2
我要匹配像mysql匹配正則表達式的確切單詞?
select col from mytable where col like '%one%two%'
2個的原話,但使用
select col from mytable where col RLIKE '[[:<:]]one[[:>:]][[:<:]]two[[:>:]]'
它沒有的工作。任何幫助表示讚賞。
我要匹配像mysql匹配正則表達式的確切單詞?
select col from mytable where col like '%one%two%'
2個的原話,但使用
select col from mytable where col RLIKE '[[:<:]]one[[:>:]][[:<:]]two[[:>:]]'
它沒有的工作。任何幫助表示讚賞。
你的正則表達式是不正確的。您需要 one
和two
之間,因爲這是兩個不同的單詞。 .*
將在這兩個單詞之間匹配0個或更多長度的文本。
使用此查詢:
select col from mytable where col RLIKE '[[:<:]]one[[:>:]].*[[:<:]]two[[:>:]]'
你嘗試全文搜索? http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html – bksi