【regex】正则表达式


集合

[0-9.]
[0-9.\-]

例子

正则表达式,按照规则写,写的时候应该不算困难,但是可读性差


不同语言中regex会有微小的差异

vim +需要转义, perl/python中+不需要转义

锚位

\b
am\b

i am

命名 / 命名捕获组 ( 捕获组(Grouping))

复制代码
// 普通捕获组
(pattern)
// 命名捕获组,两种写法等价
(?<name>pattern) 或 (?'name'pattern)

[0-9.\-]+
(?<ta>[0-9.\-]+)

i amptuitu

工具

regexper

jex.im

https://www.autoregex.xyz/


https://regex101.com/

DFA / NFA

相关推荐
IT陈图图19 小时前
基于 Flutter × OpenHarmony 的正则表达式测试器开发实战
flutter·正则表达式·openharmony
不平衡的叉叉树3 天前
我们遇到了正则表达式的灾难性回溯问题
java·正则表达式
Meteors.3 天前
正则表达式及其常见使用(Kotlin版)
正则表达式
至此流年莫相忘3 天前
正则表达式之捕获分组——Python篇
python·正则表达式
西红市杰出青年3 天前
crawl4ai------AsyncPlaywrightCrawlerStrategy使用教程
开发语言·python·架构·正则表达式·pandas
噎住佩奇4 天前
正则表达式(Regex)入门
运维·正则表达式
Irene19915 天前
JavaScript 正则表达式 API 总结
正则表达式
linuxxx1105 天前
正则匹配应用小案例
数据库·正则表达式
威风的虫5 天前
常用的正则表达式
正则表达式
Lv11770085 天前
Visual Studio中的正则表达式
ide·笔记·正则表达式·c#·visual studio