正则表达式测试器
隐私:所有正则匹配均在浏览器本地完成,不会上传任何数据。
正则表达式测试器
在线测试正则表达式,实时高亮匹配,内置模式说明、替换预览和常用模式库,完全本地运行。
标志: g 标志用于匹配高亮
警告:输入过长或模式复杂,可能导致浏览器卡顿。请谨慎使用。
匹配结果
匹配结果 (0)
- 未找到匹配项
模式说明
- 输入正则表达式查看说明
正则速查表
锚点
^start of line$end of line\bword boundary\Bnon-word boundary\Astart of input\Zend of input
字符类
.any char (except newline)\ddigit (0-9)\wword char (a-z, A-Z, 0-9, _)\swhitespace[abc]one of: a, b, c[^abc]not one of: a, b, c
量词
*zero or more+one or more?zero or one{n}exactly n{n,}n or more{n,m}n to m
分组
(abc)capture group(?:abc)non-capturing group(?<name>abc)named groupa|balternation\1backreference
环视
(?=abc)positive lookahead(?!abc)negative lookahead(?<=abc)positive lookbehind(?<!abc)negative lookbehind