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