当前位置:网站首页>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';
边栏推荐
- July Huaqing learning-1
- Matlab boundarymask function (find the boundary of the divided area)
- 调查显示传统数据安全工具在60%情况下无法抵御勒索软件攻击
- [yolov5.yaml parsing]
- ACID事务理论
- [pytorch pre training model modification, addition and deletion of specific layers]
- 嵌入式软件架构设计-消息交互
- Is investment and finance suitable for girls? What financial products can girls buy?
- MVVM framework part I lifecycle
- Mmclassification training custom data
猜你喜欢
Use and install RkNN toolkit Lite2 on itop-3568 development board NPU
谜语1
Uniapp + unicloud + Unipay realize wechat applet payment function
Reinforcement learning - learning notes 3 | strategic learning
Simple production of wechat applet cloud development authorization login
16 channel water lamp experiment based on Proteus (assembly language)
Pytorch MLP
Multi table operation - sub query
[configuration method of win11 multi-user simultaneous login remote desktop]
【L1、L2、smooth L1三类损失函数】
随机推荐
Thoughts and suggestions on the construction of intelligent management and control system platform for safe production in petrochemical enterprises
15 methods in "understand series after reading" teach you to play with strings
Vscode shortcut key
一类恒等式的应用(范德蒙德卷积与超几何函数)
【ijkplayer】when i compile file “compile-ffmpeg.sh“ ,it show error “No such file or directory“.
Image hyperspectral experiment: srcnn/fsrcnn
[loss functions of L1, L2 and smooth L1]
Reinforcement learning - learning notes 3 | strategic learning
【TFLite, ONNX, CoreML, TensorRT Export】
【云原生 | Kubernetes篇】Ingress案例实战(十三)
[untitled]
Open3d European clustering
Matlab boundarymask function (find the boundary of the divided area)
Halcon 模板匹配实战代码(一)
【load dataset】
2022年国内云管平台厂商哪家好?为什么?
Codeforces Round #804 (Div. 2)
Proof of the thinking of Hanoi Tower problem
POJ-2499 Binary Tree
Linux安装部署LAMP(Apache+MySQL+PHP)