查找工具

↑↓ 选择 Enter 打开

不知道工具名称时,可输入“格式化”或“计数”等任务词。

Regex Tester

仅本地处理

Regex Tester 用于在浏览器中检查数据,并清楚显示处理结果和限制。 本页包含该工具的实际输入输出、实现边界和一手参考资料。

已审核 · 更新于 · 免费使用 · 无需账号

//
Test text0 chars
Match preview0 matches
Matches and capture groups
#MatchIndexCapture groups
No matches yet.
Uses the JavaScript RegExp engine. Tests stop after 300 ms or 1,000 matches.

Regex Tester可以处理什么?

Regex Tester 用于在浏览器中检查数据,并清楚显示处理结果和限制。 已核对的功能: JavaScript RegExp engine, Capture groups, 300 ms worker timeout, 1,000-match cap.

Test against the deployment engine

Use this page for JavaScript patterns. Verify a PCRE, Python, .NET, Java, database, or proxy pattern in that exact engine before deployment.

如何使用?

  1. Enter the pattern without surrounding slash characters.
  2. Choose JavaScript flags and paste representative test text.
  3. Inspect highlighted matches, indexes, and capture groups.

实际输入输出示例

Capture a named numeric identifier

输入

Pattern: order-(?<id>\d+)
Text: order-1042

输出

Match: order-1042
Named group id: 1042

The browser exposes the full match and the named capture from the JavaScript RegExp result.

常见错误与修复方法

现象可能原因修复方法
A valid-looking pattern is rejected.It uses syntax from another regex engine or an unsupported browser flag.Rewrite the expression for the target JavaScript runtime.
Testing times out.The expression backtracks heavily on the supplied text.Make repetitions more specific, reduce ambiguity, or use a parser.

A timeout indicates expensive matching

该工具的实际边界: Nested quantifiers and ambiguous repeated groups can cause excessive backtracking. A 300 ms timeout protects the page but does not certify production safety.

标准与实现参考

关于Regex Tester的常见问题

Which regex engine is used?

The page uses JavaScript RegExp; PCRE, Python, .NET, and Java can behave differently.

Are capture groups shown?

Yes. Numbered captures and named groups are shown for displayed matches.

What does the timeout mean?

The worker is stopped after 300 ms to reduce page freezes; this is not proof that a pattern is safe.

更新记录

本次实质更新: Regex Tester: Added JavaScript flag validation, highlighted matches, capture groups, a 1,000-match cap, and 300 ms worker termination for slow patterns.

谁在维护这个工具?

KL
KitLumi EngineeringKitLumi 工程团队负责维护工具行为、隐私说明、示例和自动化测试。