Test regex online with real-time match highlighting, capture group inspection and replace testing, plus 15+ built-in patterns
Type a pattern and test text to see live highlights, capture groups and replacement results - with one-click presets.
了解正则表达式测试器的功能、常用模板与常见问题。What this regex tester does, its built-in patterns, and answers to common questions.
正则表达式测试器支持实时匹配高亮、捕获组展示与替换测试,并提供手机号、邮箱、身份证、URL、IP、日期等 15+ 常用模板。
The regex tester provides real-time match highlighting, capture group inspection and replace testing, with 15+ built-in patterns for phones, emails, ID cards, URLs, IPs, dates and more.
支持 g/i/m/s/u/y 六种标志,替换功能支持 $1 反向引用,全程本地处理不上传。
Supports the g/i/m/s/u/y flags, replacement with $1 back-references, all processed locally.
模式输入框会变红并提示错误原因,不影响页面其他部分。The pattern box turns red with the error message; the rest of the page keeps working.
支持,使用 $1、$2… 引用捕获组,如把 (\\d{3})-(\\d{4}) 替换为 $1$2。Yes, use $1, $2… to reference groups, e.g. replace (\\d{3})-(\\d{4}) with $1$2.
不会,匹配与替换全部在浏览器本地完成。No, matching and replacement happen entirely in your browser.
未勾选 g(全局)标志时默认只匹配第一个,勾选 g 后匹配所有。Without the g (global) flag only the first match is shown; enable g to match all.