当前位置:网站首页>MySQL regular expression
MySQL regular expression
2022-07-05 12:12:00 【ziyi813】
MySQL Regular expressions
Introduce
Regular expressions (regular expression) Describes a string matching rule , The regular expression itself is a string , Use this string to describe 、 To define rules , Matches a series of strings that conform to a syntax rule .
In development , Regular expressions are often used to retrieve , Replace the text that conforms to a rule .
MySQL Use REGEXP Keyword supports string matching with regular expressions .
Format
Pattern | describe |
---|---|
^ | Matches the start of the input string |
$ | Matches the end of the input string |
. | Matching elimination \n Any single character other than |
[…] | Character set . Matches any of the contained characters , for example :[‘abc’] Can match "plain" Medium a |
[^…] | Negative character set . Match any character not included . for example :[‘abc’] Can match "plain" Medium p |
p1|p2|p3 | matching p1 perhaps p2 or p3. for example :'z|food’ Can match "z" perhaps "food"."(z|f)ood" matching "zood" perhaps "food" |
* | Matches the previous subexpression zero or more times . for example :zo* Can match "z" as well as zoo. |
+ | Match the previous subexpression one or more times |
{n} | n Is a non negative integer , Matched definite n Time |
{n,m} | m and n All non negative integers , among n <= m. Least match n Times and at most m Time |
The operation sample
-- ^ start Search for items with names beginning with sea in the item table
select * from product where pname REGEXP '^ The sea ';
-- . Match any single character
select 'abc' REGEXP '.b';
边栏推荐
- 【pytorch 修改预训练模型:实测加载预训练模型与模型随机初始化差别不大】
- [deploy pytoch project through onnx using tensorrt]
- byte2String、string2Byte
- 【PyTorch预训练模型修改、增删特定层】
- Take you two minutes to quickly master the route and navigation of flutter
- What is digital existence? Digital transformation starts with digital existence
- 一款新型的智能家居WiFi选择方案——SimpleWiFi在无线智能家居中的应用
- Xi IO flow
- Network five whip
- redis主从中的Master自动选举之Sentinel哨兵机制
猜你喜欢
[cloud native | kubernetes] actual battle of ingress case (13)
Intern position selection and simplified career development planning in Internet companies
[singleshotmultiboxdetector (SSD, single step multi frame target detection)]
[pytorch pre training model modification, addition and deletion of specific layers]
Select drop-down box realizes three-level linkage of provinces and cities in China
How to clear floating?
强化学习-学习笔记3 | 策略学习
[configuration method of win11 multi-user simultaneous login remote desktop]
redis主从中的Master自动选举之Sentinel哨兵机制
[loss functions of L1, L2 and smooth L1]
随机推荐
一次生产环境redis内存占用居高不下问题排查
【load dataset】
vscode快捷键
谜语1
Halcon 模板匹配实战代码(一)
Tabbar configuration at the bottom of wechat applet
Riddle 1
Pytorch MLP
手机 CPU 架构类型了解
Simply solve the problem that the node in the redis cluster cannot read data (error) moved
自动化测试生命周期
Codeforces Round #804 (Div. 2)
Automated test lifecycle
Principle of persistence mechanism of redis
redis主从中的Master自动选举之Sentinel哨兵机制
splunk配置163邮箱告警
Codeforces Round #804 (Div. 2)
Principle and performance analysis of lepton lossless compression
Matlab imoverlay function (burn binary mask into two-dimensional image)
【TFLite, ONNX, CoreML, TensorRT Export】