当前位置:网站首页>sql中常用到的正则表达
sql中常用到的正则表达
2022-08-01 12:51:00 【牧码文】
不以某个字符开头
select 'hello world' regexp '^(?!hello).*'
获取某个字符后所有的字符
select regexp_extract('hello world', '( )(.*)', 2)
是否包含某个字符
select 'hello world' regexp 'hello';
正则的修饰符
i : ignore,不区分大小写
g:global,全局匹配
m:multi line,多行匹配
s:使用 . 时包含换行符 \n
/hello./gmis
元字符
±?.
正向肯定预查
(?=pattern)
正向否定预查
(?!pattern)
反向肯定预查
(?<=pattern)
反向否定预查
(?<!pattern)
常用的正则语法
.- 除换行符以外的所有字符。^- 字符串开头。$- 字符串结尾。\d,\w,\s- 匹配数字、字符、空格。\D,\W,\S- 匹配非数字、非字符、非空格。[abc]- 匹配 a、b 或 c 中的一个字母。[a-z]- 匹配 a 到 z 中的一个字母。[^abc]- 匹配除了 a、b 或 c 中的其他字母。aa|bb- 匹配 aa 或 bb。?- 0 次或 1 次匹配。*- 匹配 0 次或多次。+- 匹配 1 次或多次。{n}- 匹配 n次。{n,}- 匹配 n次以上。{m,n}- 最少 m 次,最多 n 次匹配。(expr)- 捕获 expr 子模式,以\1使用它。(?:expr)- 忽略捕获的子模式。(?=expr)- 正向预查模式 expr。(?!expr)- 负向预查模式 expr。
边栏推荐
- leetcode: 1201. Ugly Number III [Dichotomy + Mathematics + Inclusion and Exclusion Principle]
- 力扣160题,相交链表
- 论文笔记All about Eve: Execute-Verify Replication for Multi-Core Servers
- SQL function SQUARE
- PanGu-Coder:函数级的代码生成模型
- Towhee 每周模型
- SQL function SQRT
- How much do you know about Amazon reviews?
- 28uA待机8米距离低压保护单片机探头太阳能灯人体PIR定制方案
- AI目标分割能力,无需绿幕即可实现快速视频抠图
猜你喜欢
随机推荐
树和二叉树的转换
SQL functions STR
markdown常用数学符号cov(markdown求和符号)
Data Mining-04
iframe tag attribute description detailed [easy to understand]
How to Integrate Your Service Registry with Istio?
人像分割技术解析与应用
意大利普拉托华社将游行示威 盼解决安全问题
Six Stones Programming: Problems must be faced, methods must be skillful, and functions that cannot be done well must be solved
postgresql之page分配管理(一)
计算器:中缀表达式转后缀表达式
LeetCode_动态规划_中等_377.组合总和 Ⅳ
Process sibling data into tree data
AI目标分割能力,无需绿幕即可实现快速视频抠图
芝加哥丰田技术学院 | Leveraging Natural Supervision for Language Representation Learning and Generation(利用自然监督进行语言表示学习和生成)
消息中间件解析 | 如何正确理解软件应用系统中关于系统通信的那些事?
leetcode:1201. 丑数 III【二分 + 数学 + 容斥原理】
Multithreading Case - Timer
Beyond Compare 4 试用期到期
This article will take you to thoroughly clarify the working mechanism of certificates in Isito









