a11y.skipToMainContent
1

Regex 测试器

测试 JavaScript 正则表达式 sive —— 参见文本中突出显示的匹配和列表中捕获的组.

More options

Common Pattern Library

Click any pattern to load it into the tester:

Quick Regex Cheatsheet

Character Classes
. Any character
\d Digit [0-9]
\w Word char [a-zA-Z0-9_]
\s Whitespace
\D Non-digit
\W Non-word char
Anchors & Boundaries
^ Line start
$ Line end
\b Word boundary
\B Non-boundary
Quantifiers
* 0 or more (greedy)
+ 1 or more (greedy)
? 0 or 1 (optional)
*? 0 or more (lazy)
{n} Exactly n times
{n,m} n to m times
Groups & Lookarounds
(...) Capturing group
(?:...) Non-capturing group
(?=...) Positive lookahead
(?!...) Negative lookahead
Was this tool helpful?
Send output to:
Advertisement

How to use Regex Tester

  1. 输入您的 regex 模式 .
  2. 选取旗帜.
  3. 粘贴测试文本——匹配亮点为活.

{姓名}是什么来着?

快速构建并调试正则表达式:键入一个图案,切换旗帜(g, i, m, s, u),并看到测试文本中突出显示的匹配. 抓取的组出现在每匹配的旁边, 以方便校验 。

Advertisement

FAQ

哪个Regex口味?
JavaScript regex (ECMAScript) (英语). 找头人,找后人,角色课,抓取组,命名组都支持.
安全限制是什么?
每跑一次10万比分 防止出逃模式.

Related tools

Author

MW
Marcus Webb"The DevTool Craftsman"

Full-Stack Developer & Tools Architect

Marcus has been writing code since the dial-up era. He has contributed to open-source developer tools, built CI/CD pipelines for startups, and debugged production incidents at 3 AM more times than he would like to admit. His philosophy is that the best developer tool is the one that gets out of your way, and he writes about practical tooling that helps teams ship faster with fewer headaches.

Advertisement