Regular expression tester
Paste text and an expression to see every match highlighted at once, with positions and capture groups, plus hints on errors
常用模式(点击填入表达式与示例文本)
匹配结果
输入表达式与文本后这里会实时显示结果;也可以先点上方一个常用模式试试。
FAQ
No. Matching and highlighting run entirely locally in the browser, without a single server request; check the developer tools Network panel and you will only see the page's own static assets.
Check in order: one, leave off the surrounding slashes - this page takes the pattern body only; two, compare the flags - case-insensitive needs i, ^ and $ matching line starts and ends needs m, the dot matching newlines needs s; three, special characters (. * + ? and the like) need backslash escaping. You can also tap the common patterns above - they fill in a pattern and sample text so you see the effect directly.
g matches globally - it lists every match, not just the first; i ignores case; m is multiline mode, where ^ and $ match line starts and ends; s lets the dot match newline characters too; u turns on Unicode mode, enabling \p{L} property escapes. The results on this page are always listed globally so you see them all at once.
A badly written regex (nested quantifiers like (a+)+) can backtrack exponentially on long text and briefly lock the page - just reload; your content only exists in the browser and was never uploaded anywhere. Validate the expression on short text first, and for long inputs prefer linear-time patterns (avoid nested quantifiers).