Regex Tester
Test regular expressions with live highlighting and match details.
Match Highlighting
Match Details
| # | Match | Index | Groups |
|---|
This tool is for informational and educational purposes only. It is not a substitute for professional financial, medical, legal, or engineering advice. See Terms of Service.
Can't find what you need?
Request a ToolHow to Use the Regex Tester
This tool lets you test regular expression patterns against any text with instant feedback. Everything runs in your browser. Here is how to use it:
- Enter your pattern. Type a regular expression in the pattern field. The pattern is shown between forward slashes to match standard regex notation.
- Set your flags. Check the boxes for the flags you need. Global (g) finds all matches. Case insensitive (i) ignores letter case. Multiline (m) makes ^ and $ match line boundaries. DotAll (s) makes the dot match newline characters.
- Enter test text. Type or paste the text you want to test against. Results update live as you type.
- Review matches. The match count appears as the primary result. Below that, matched text is highlighted in the test string. A table shows each match with its position and any captured groups.
- Copy or share. Copy the match list or share a link that preserves your pattern, flags, and test string.
About the Regex Tester
Regular expressions are patterns used to match character combinations in text. They are essential for text processing, data validation, search-and-replace operations, and log parsing. This tool uses your browser's native JavaScript RegExp engine, so patterns behave exactly as they would in JavaScript, Node.js, and TypeScript code. It supports named capture groups, lookaheads, lookbehinds (in modern browsers), Unicode escapes, and all standard quantifiers. Your test data never leaves your browser.
Frequently Asked Questions
What regex syntax does this tool support?
This tool uses JavaScript's built-in RegExp engine, so it supports all syntax that your browser supports. This includes character classes, quantifiers, groups, backreferences, lookaheads, lookbehinds (Chrome 62+, Firefox 78+, Safari 16.4+), named groups, and Unicode property escapes. Patterns that work here will work in any JavaScript or Node.js application.
What do the flags (g, i, m, s) mean?
The g (global) flag finds all matches instead of stopping after the first. The i (case insensitive) flag ignores uppercase and lowercase differences. The m (multiline) flag makes ^ and $ match the start and end of each line, not just the entire string. The s (dotAll) flag makes the . character match newline characters, which it normally does not.
Why does my pattern match differently than expected?
Common issues include: forgetting to enable the global flag (only the first match is returned), not escaping special characters like dots or parentheses (use \. and \( instead), greedy vs lazy quantifiers (* matches as much as possible, *? matches as little as possible), and anchors (^ and $) not working on individual lines without the multiline flag.
Is my data sent to a server?
No. All regex matching happens in your browser using JavaScript. Your pattern and test string are never transmitted anywhere. When you use the Share feature, the pattern and a portion of the test string are encoded in the URL itself, not stored on a server.