首页开发工具正则表达式测试

正则表达式测试

在线测试正则表达式。实时匹配高亮显示,支持捕获组。

//

Frequently Asked Questions

How do I test a regular expression?

Enter your regex pattern (like /[a-z]+/g) in the pattern field, type or paste your test text below, and matches appear instantly highlighted. The tool shows match position, matched text, and capture groups.

What do the regex flags g, i, m mean?

g = global (find all matches, not just the first). i = case-insensitive. m = multiline (^ and $ match line starts/ends). Combine them: "gim" for all three.

Why is my regex not matching?

Common issues: forgetting to escape special characters (use \ before . * + ? [ ] ( ) { } | ^ $), wrong flags, or mismatched parentheses. The tool shows error messages to help debug.