正则表达式测试
实时测试正则表达式,高亮显示匹配结果
🔒 100% client-side — your data never leaves this pageRegex
//
Test String
🔒 100% client-side
输出
Matches will appear here
Quick Reference
.any char\ddigit\wword char\swhitespace^start$end*0 or more+1 or more?0 or 1{n}exactly n[abc]char class(x)groupAbout this tool
输入正则表达式和测试文本,即时显示所有匹配项、匹配位置和捕获组。支持所有 JavaScript 正则标志(g、i、m、s),内置常用表达式快速参考。
Frequently Asked Questions
Which regex flavor is used?
This tool uses JavaScript regular expressions (the built-in RegExp engine), which supports most common regex syntax including lookahead, named groups, and Unicode.
What do the flags mean?
g (global) finds all matches. i (case insensitive) ignores case. m (multiline) makes ^ and $ match line boundaries. s (dotAll) makes . match newlines too.
How do I use capture groups?
Wrap part of your pattern in parentheses: (\w+). Each group appears separately in the match results, making it easy to extract specific parts of a match.