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

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

Jun 13, 2016 pm 01:12 PM
comment select topic where

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

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

Statement of this Website
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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Asynchronous processing method of Select Channels Go concurrent programming using golang Asynchronous processing method of Select Channels Go concurrent programming using golang Sep 28, 2023 pm 05:27 PM

Asynchronous processing method of Select Channels Go concurrent programming using golang

What is the concept of mysql comment What is the concept of mysql comment Jun 02, 2023 pm 05:34 PM

What is the concept of mysql comment

How to hide the select element in jquery How to hide the select element in jquery Aug 15, 2023 pm 01:56 PM

How to hide the select element in jquery

How to implement change event binding of select elements in jQuery How to implement change event binding of select elements in jQuery Feb 23, 2024 pm 01:12 PM

How to implement change event binding of select elements in jQuery

A Practical Guide to the Where Method in Laravel Collections A Practical Guide to the Where Method in Laravel Collections Mar 10, 2024 pm 04:36 PM

A Practical Guide to the Where Method in Laravel Collections

How to use the Where method in Laravel collections How to use the Where method in Laravel collections Mar 10, 2024 pm 10:21 PM

How to use the Where method in Laravel collections

What is the reason why Linux uses select? What is the reason why Linux uses select? May 19, 2023 pm 03:07 PM

What is the reason why Linux uses select?

From beginner to proficient: Master the skills of using is and where selectors From beginner to proficient: Master the skills of using is and where selectors Sep 08, 2023 am 09:15 AM

From beginner to proficient: Master the skills of using is and where selectors

See all articles