正则测试
编写 JavaScript RegExp、设置修饰符并对照测试文本。匹配在浏览器本地完成。
All processing on this page runs locally in your browser unless noted otherwise.
//gi
109 个字符
高亮预览
0 处匹配 · 0 个分组 · 0 ms
Contact [email protected] or [email protected]
Phone: 13812345678
https://regex.toolsworkbox.com/regex匹配结果
| # | 完整匹配 | 分组 | 起止位置 | |
|---|---|---|---|---|
| 暂无匹配。 | ||||
代码片段
其它语言的示意片段。本页实际匹配仍使用 JavaScript RegExp。
const pattern = /[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}/gi
const text = `your test text`
const matches = [...text.matchAll(pattern)]
console.log(matches.map(m => m[0]))点击下方 Tab 懒加载二期能力。
How to use
- 输入正则主体(无需斜杠)并勾选修饰符。
- 粘贴测试文本;输入防抖后自动匹配,或按 Ctrl+Enter。
- 按需使用模板、历史与代码片段;可通过 URL 分享当前状态。
FAQ
使用哪种正则引擎?
浏览器中的 JavaScript RegExp。PHP / Python 代码片段仅作写法示意。
文本会上传吗?
不会。匹配在本地完成。草稿与历史保存在本机 localStorage。
为什么高亮关闭了?
超过 8000 字符时关闭内联高亮以保持流畅;结果表仍可用。