当前位置:网站首页>MySQL 正则表达式
MySQL 正则表达式
2022-07-18 01:38:00 【抓手】
MySQL 支持正则表达式的匹配, MySQL中使用 REGEXP 操作符来进行正则表达式匹配。
SELECT * FROM `t_user` WHERE user_name REGEXP ?| 模式 | 描述 |
|---|---|
| ^ | 匹配输入字符串的开始位置。如果设置了 RegExp 对象的 Multiline 属性,^ 也匹配 '\n' 或 '\r' 之后的位置。 |
| $ | 匹配输入字符串的结束位置。如果设置了RegExp 对象的 Multiline 属性,$ 也匹配 '\n' 或 '\r' 之前的位置。 |
| . | 匹配除 "\n" 之外的任何单个字符。要匹配包括 '\n' 在内的任何字符,请使用像 '[.\n]' 的模式。 |
| [...] | 字符集合。匹配所包含的任意一个字符。例如, '[abc]' 可以匹配 "plain" 中的 'a'。 |
| [^...] | 负值字符集合。匹配未包含的任意字符。例如, '[^abc]' 可以匹配 "plain" 中的'p'。 |
| p1|p2|p3 | 匹配 p1 或 p2 或 p3。例如,'z|food' 能匹配 "z" 或 "food"。'(z|f)ood' 则匹配 "zood" 或 "food"。 |
| * | 匹配前面的子表达式零次或多次。例如,zo* 能匹配 "z" 以及 "zoo"。* 等价于{0,}。 |
| + | 匹配前面的子表达式一次或多次。例如,'zo+' 能匹配 "zo" 以及 "zoo",但不能匹配 "z"。+ 等价于 {1,}。 |
| {n} | n 是一个非负整数。匹配确定的 n 次。例如,'o{2}' 不能匹配 "Bob" 中的 'o',但是能匹配 "food" 中的两个 o。 |
| {n,m} | m 和 n 均为非负整数,其中n <= m。最少匹配 n 次且最多匹配 m 次。 |
边栏推荐
- 无心剑中译狄兰·托马斯《不要温顺地走进那个良夜》
- 解决MATLAB安装后出现 “License Manager Error -8”(亲测有效)
- 基于二叉树的传球问题思考与推测
- First knowledge of convolution +matlab's intuitive understanding of discrete convolution process
- MySQL - 表字段的自增约束
- 总结阅读器与直播的奇怪交互:复习双迪技术
- 在网上办理基金开户业务安全吗?在校大学生求指导
- The NFT market pattern has not changed. Can okaleido set off a new round of waves?
- 各版本VOS服务的停止、启动和重启命令详解
- Interference signal radiated from motor
猜你喜欢
![LeetCode 565 数组嵌套[dfs 记忆化] HERODING的LeetCode之路](/img/d3/1d0f6668d9543136c729153bdebff0.png)
LeetCode 565 数组嵌套[dfs 记忆化] HERODING的LeetCode之路

Ugui source code analysis - iclipper

Anaconda的基本使用与在Pycharm中使用

MySQL - 表字段的自增约束

ArrayList源码解析一

CH549/CH548学习笔记8 - USB Device中断处理

Ch549/ch548 learning notes 1 - hardware design

深度学习环境配置TensorFlow2+Keras

Csgo suddenly returns to the desktop, and other applications are unresponsive. How can we not restart and close it

Liquibase learning 2 - Introduction to the extension plug-in liquibase data
随机推荐
openresty lua-resty-lrucache缓存
ArrayList源码解析一
Ch549/ch548 learning notes 3 - UART
【單片機仿真項目】報警燈(proteus原理圖+keil代碼)
[projet de simulation MCU] feu d'alarme (schéma Proteus + Code clé)
Does flush software charge for online account opening for stock speculation? Is it safe to open an account?
Okaleido或杀出NFT重围,你看好它吗?
[MCU simulation project] advertising lamp (Proteus schematic +keil code)
Identity server 4 uses openid connect to add user authentication (3)
BFD of HCNP Routing & Switching
Ch549/ch548 learning notes 1 - hardware design
ROS与STM32通信的实现
Latex基本语法总结
解决MATLAB安装后出现 “License Manager Error -8”(亲测有效)
【单片机仿真项目】LED 闪烁灯(proteus原理图+keil代码)
Ch549/ch548 learning notes 8 - USB device interrupt processing
MySQL -调整列的约束
About the problem that only one IP can be accessed after dual network cards are configured
论文阅读 TEMPORAL GRAPH NETWORKS FOR DEEP LEARNING ON DYNAMIC GRAPHS
[today in history] July 17: Softbank acquired arm; The first email interruption; Wikimedia International Conference