现在的位置: 首页 > 综合 > 正文

MySQL的REGEXP 和 like 在匹配上的区别

2013年02月15日 ⁄ 综合 ⁄ 共 269字 ⁄ 字号 评论关闭

MySQL的REGEXP 和 like 在匹配上的区别

其中like要求整个数据都要匹配,而REGEXP只需要部分匹配即可。


也就是说,用Like,必须这个字段的所有内容满足条件,而REGEXP只需要有任何一个片段满足即可。




A REGEXP pattern match succeeds if the pattern matches anywhere in
the value being tested. (This differs from a LIKE pattern match, which
succeeds only if the pattern matches the entire value.)

抱歉!评论已关闭.