当前位置:网站首页>16. Learn MySQL Regular Expressions
16. Learn MySQL Regular Expressions
2022-08-04 14:36:00 【Microservice spring cloud】
MySQL Regular Expression
In the previous chapter we have learned that MySQL can perform fuzzy matching through LIKE ...% .
MySQL also supports the matching of other regular expressions. MySQL uses the REGEXP operator for regular expression matching.
If you know PHP or Perl, it's pretty straightforward, as MySQL's regular expression matching is similar to those of these scripts.
The regular patterns in the table below can be applied to the REGEXP operator.

Instance
After understanding the above regular requirements, we can write SQL statements with regular expressions according to our own requirements.Below we will list a few small examples (table name: person_tbl ) to deepen our understanding:
Find all data starting with 'st' in the name field:
mysql> SELECT name FROM person_tbl WHERE name REGEXP '^st';Find all data in the name field that ends with 'ok':
mysql> SELECT name FROM person_tbl WHERE name REGEXP 'ok$';Find all data containing the string 'mar' in the name field:
mysql> SELECT name FROM person_tbl WHERE name REGEXP 'mar';Finds all data in the name field that begins with a vowel character or ends with the string 'ok':
mysql> SELECT name FROM person_tbl WHERE name REGEXP '^[aeiou]|ok$';边栏推荐
猜你喜欢

七夕邂逅爱,那人一定在

技术分享| 融合调度系统中的电子围栏功能说明

自监督学习未来是掩码自编码器?KAIST最新《自监督学习掩码自编码器》研究进展

广告电商系统开发功能只订单处理

Find My Technology | Prevent your pet from getting lost, Apple Find My technology can help you

token 过期后,如何自动续期?

【Web技术】1401- 图解 Canvas 入门

leetcode:250. 统计同值子树

Redis 复习计划 - Redis主从数据一致性和哨兵机制

This week to discuss the user experience: Daedalus Nemo to join Ambire, explore the encryption of the ocean
随机推荐
1403. 非递增顺序的最小子序列
一看就会的Chromedriver(谷歌浏览器驱动)安装教程
Bluetooth Technology|In the first half of the year, 1.3 million charging piles were added nationwide, and Bluetooth charging piles will become the mainstream of the market
How to write SQL statements: the usage of Update, Case, and Select together
centos7安装mysql急速版
OAID是什么
JCMsuite应用:倾斜平面波传播透过光阑的传输
word2003按空格键为什么会出现小数点
F. Jinyu and its outer matrix (construction)
2042. 检查句子中的数字是否递增-力扣双百代码-设置前置数据
集合划分差最小问题(01背包)
[The Art of Hardware Architecture] Study Notes (1) The World of Metastability
兆骑科创创新创业大赛活动举办,线上直播路演,投融资对接
AOSP内置APP特许权限白名单
利用决策树找出最优特征组合
自监督学习未来是掩码自编码器?KAIST最新《自监督学习掩码自编码器》研究进展
快解析结合友加畅捷U+
ICML 2022 | 图神经网络的局部增强
Set partition minimum difference problem (01 knapsack)
Database recovery