返回开发工具

正则表达式测试器

在浏览器中测试正则表达式,实时高亮匹配项、捕获组与命名组,内置邮箱、URL、UUID、IPv4 等常用预设。

正则模式
/g/
测试文本198 chars · 5 lines
高亮结果在上方输入正则模式以开始匹配。
Contact us at hello@vectobox.com or support@example.org.
Visit https://vectobox.com/tools for more info.
UUID: 550e8400-e29b-41d4-a716-446655440000
IP: 192.168.1.1, 10.0.0.255
Phone: +1-415-555-0132
匹配项0
在上方输入正则模式以开始匹配。
预设
正则速查表
字符类
\d  digit
\w  word char
\s  whitespace
[abc]  any of a, b, c
[^abc]  none of a, b, c
.  any char (except newline)
锚点
^  start of line/string
$  end of line/string
\b  word boundary
\B  non-word boundary
量词
*  0 or more
+  1 or more
?  0 or 1
{n}  exactly n
{n,m}  n to m
+?  lazy
分组
(abc)  capture group
(?:abc)  non-capturing
(?<name>abc)  named group
|  alternation
\1  backreference

相关工具