Home >Backend Development >PHP Tutorial > mysql 正则查询信息,该如何处理

mysql 正则查询信息,该如何处理

WBOY
WBOYOriginal
2016-06-13 13:12:171022browse

mysql 正则查询信息
我想查询带有中括号的数据 如 参加合约计划即可优惠200-1000元。[嘻嘻]有意联系
  他就有'[ ]'这个 !但是我
SELECT *
FROM `topic_comment`
WHERE content
REGEXP '\[(.*)+\]'
  这样查询感觉怎么没用啊

------解决方案--------------------
SELECT *
FROM `topic_comment`
WHERE content
REGEXP '\\[.*\\]'
------解决方案--------------------
严重错误的做法!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn