当前位置:网站首页>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。
边栏推荐
- VIP的实现原理
- 8. How does the SAP ABAP OData service support the Create operation
- SAP ABAP OData 服务如何支持创建(Create)操作试读版
- Grafana9.0发布,Prometheus和Loki查询生成器、全新导航、热图面板等新功能!
- 10年稳定性保障经验总结,故障复盘要回答哪三大关键问题?|TakinTalks大咖分享
- Feign 从注册到调用原理分析
- Beyond Compare 4 trial period expires
- PIR人体感应AC系列感应器投光灯人体感应开关等应用定制方案
- 脚本语言Lua的基础知识总结
- 消息中间件解析 | 如何正确理解软件应用系统中关于系统通信的那些事?
猜你喜欢

AD单片机九齐单片机NY8B062D SOP16九齐

Dameng replaces the officially authorized dm.key

How do we do full-link grayscale on the database?
![leetcode: 1201. Ugly Number III [Dichotomy + Mathematics + Inclusion and Exclusion Principle]](/img/44/bf1d9b9d85939e73bc44be2f9701e1.png)
leetcode: 1201. Ugly Number III [Dichotomy + Mathematics + Inclusion and Exclusion Principle]

8. SAP ABAP OData 服务如何支持创建(Create)操作

NebulaGraph v3.2.0 Performance Report

全链路灰度在数据库上我们是怎么做的?

Alibaba Cloud Official Redis Development Specification

库函数的模拟实现(strlen)(strcpy)(strcat)(strcmp)(strstr)(memcpy)(memmove)(C语言)(VS)

英特尔全方位打造算力基础,助推“算”赋百业
随机推荐
并发编程10大坑,你踩过几个?
让程序员早点下班的效率工具
英特尔全方位打造算力基础,助推“算”赋百业
Simulation implementation of new of Js handwritten function
Dapr 与 NestJs ,实战编写一个 Pub & Sub 装饰器
This article will take you to thoroughly clarify the working mechanism of certificates in Isito
Software designer test center summary (interior designer personal summary)
LeetCode_位运算_简单_405.数字转换为十六进制数
Find objects with the same property value Cumulative number Summarize
将同级数据处理成树形数据
数字孪生北京故宫,元宇宙推进旅游业进程
四足机器人软件架构现状分析
SQL function SQUARE
CloudCompare&PCL ICP配准(点到面)
AI目标分割能力,无需绿幕即可实现快速视频抠图
什么是一致性哈希?可以应用在哪些场景?
28uA待机8米距离低压保护单片机探头太阳能灯人体PIR定制方案
快速理解拉格朗日乘子法
【无标题】
postgresql之page分配管理(二)