Regex Tester
Test regular expressions against live sample text with match highlighting.
Free · No sign-up · Runs locally in your browser · Also available in Chinese (中文)
What is Regex Tester?
A regex tester lets you write a regular expression and see exactly what it matches in real sample text — every match and capture group highlighted in place. Regex syntax is compact and unforgiving; this feedback loop turns a guessing game into a visual one.
The tool supports the standard JavaScript regex engine, including flags for global, case-insensitive and multiline matching. Everything runs locally, so it is safe to paste customer data, log lines or private snippets while debugging a pattern.
How to use it
- 1Paste or type your sample text into the test area.
- 2Write the pattern and set flags such as g (global) or i (case-insensitive).
- 3Inspect the highlighted matches and capture-group list below.
- 4Refine the pattern until the highlights cover exactly what you want.
Common use cases
- Extracting dates, emails or order numbers from unstructured log text.
- Building a validation pattern for form input and proving it against edge cases.
- Understanding a pattern you copied from documentation by seeing its matches.
Frequently asked questions
▸Why does my pattern match less than expected?
Most often a missing g flag (only the first match is shown) or greedy vs lazy quantifiers. Toggle the global flag and compare .* with .*? to see the difference live.
▸Which regex flavor is used?
The JavaScript (ECMAScript) engine, which covers the syntax most web tools accept. Lookbehind is supported in modern browsers.