MDevTools

Regex Tester正则表达式测试

Test regular expressions and see matches live.

实时测试正则表达式,查看匹配数量与命中内容,方便调试抓取与替换规则。

What is Regex Tester?正则表达式测试 是什么?

A regex tester runs your regular expression against sample text and highlights every match live, so you can iterate on a pattern without editing code. It supports flags for case-insensitivity, multiline and global matching, shows capture groups, and reports syntax errors as you type. All matching runs locally in your browser.

正则测试器用你的正则表达式实时匹配示例文本并高亮所有结果,让你不写代码就能调好 Pattern。它支持忽略大小写、多行、全局等标志位,展示捕获组,并在输入时即报告语法错误。匹配全部在浏览器本地执行。

How to use regex tester如何使用 正则表达式测试

  1. Enter your regular expression in the pattern box, without the surrounding slashes.
  2. Paste the sample text you want to match against.
  3. Toggle flags such as case-insensitive, multiline or global as needed.
  4. Read the highlighted matches and the capture groups, then copy the finished pattern.
  1. 在表达式框输入正则,不要带两侧斜杠。
  2. 粘贴要匹配的示例文本。
  3. 按需开启忽略大小写、多行、全局等标志。
  4. 查看高亮匹配与捕获组,然后复制最终表达式。

Common uses常见用途

FAQ常见问题

Which regex flavour is used?用哪种正则语法?

JavaScript regular expressions, as implemented by your browser. Most Perl-compatible patterns work unchanged, but a few advanced features differ between engines.

JavaScript 正则,即你浏览器的实现。大多数 Perl 兼容写法可直接使用,但少数高级特性在不同引擎间有差异。

Why does my pattern match nothing?为什么我的表达式匹配不到?

Check the flags. Without the global flag only the first match is reported, and without case-insensitive matching the case must match exactly. Also confirm you did not include the surrounding slashes.

先看标志位:不加全局只报第一个匹配,不开忽略大小写则大小写必须一致;再确认没有把两侧斜杠一起粘进去。

What are capture groups?什么是捕获组?

Parentheses in a pattern create groups that capture the matched substrings. They are listed separately so you can see exactly which part of the match each group caught.

表达式中的圆括号会捕获匹配到的子串,工具会单独列出,让你看清每组到底抓到了哪一部分。

Is my sample text uploaded?示例文本会被上传吗?

No. Matching runs in your browser, so logs and data containing sensitive values stay on your machine.

不会。匹配在浏览器内执行,含敏感值的日志和数据留在本机。

Other tools其他工具

🧾

JSON FormatterJSON 格式化

Format, validate and minify JSON — Chinese-safe, runs in your br…

格式化、校验并压缩 JSON,支持中文与错误定位。全程在浏览器本地完成。…

🔤

Base64 Encode / DecodeBase64 编解码

Encode or decode Base64 text with UTF-8 and URL-safe support.…

对文本进行 Base64 编码或解码,支持 UTF-8 中文与 URL 安全字符…

🔗

URL Encode / DecodeURL 编解码

Percent-encode or decode URLs, params and text.…

对网址、参数或文本进行 URL 百分号编码与解码,方便调试接口与链接。…

#️⃣

Hash Generator哈希生成

Generate MD5, SHA-1, SHA-256 or SHA-512 hashes.…

用 MD5、SHA-1、SHA-256 或 SHA-512 为文本生成哈希值,常…

🆔

UUID GeneratorUUID 生成

Generate random UUID v4 identifiers.…

一键生成多个随机 UUID v4,用于主键、追踪 ID 与测试数据。…

🎫

JWT DecoderJWT 解码

Decode a JSON Web Token locally, no upload.…

在浏览器本地解码 JSON Web Token 的 Header 与 Paylo…

Sister sites友情链接 MonkeyDev dev tools hub工具总站 FreePDFKit PDF toolsPDF 工具集 ImageToolKit image tools图片工具集 AI 咒语库 AI prompt libraryAI 提示词库 CalcKit finance calculators财务计算器 OfficeKit office utilities办公工具箱 AIkit AI & machine learningAI 与机器学习 DataKit data & spreadsheet tools数据与表格工具 ChartKit diagrams & charts图表与可视化 DocKit markdown & document toolsMarkdown 与文档工具