Regex Tester
Type a regular expression and a test string and see every match highlighted as you type, along with the capture groups. The tester uses the JavaScript regular expression engine of your browser.
Matches highlighted
Runs entirely in your browser. Nothing you enter is sent to a server.
How to use it
- Type your expression in the first box, without the slashes.
- Choose the flags you need. g finds all matches instead of only the first.
- Paste or type the text you want to test.
- Read the highlighted preview and the list of matches and groups below it.
Flags
- g (global): find all matches, not just the first.
- i (ignore case): A matches a.
- m (multiline): ^ and $ match at the start and end of each line.
- s (dotAll): the dot also matches line breaks.
- u (unicode): treat the pattern as Unicode, needed for emoji and for \p{...} properties.
Frequently asked questions
- Which regex flavor does this use?
- JavaScript (ECMAScript). Most syntax is shared with other languages, but some features differ, such as lookbehind support, named group syntax and possessive quantifiers.
- Why does the page freeze with some patterns?
- Patterns with nested repetition, like (a+)+, can take exponential time on some inputs (catastrophic backtracking). Simplify the pattern or reload the page.
- How do I match a literal dot or bracket?
- Escape it with a backslash: \. matches a dot and \[ matches a square bracket.
- Is my text uploaded?
- No. The test runs in your browser.
More tools
- JSON Formatter & Validator
- Base64 Encoder & Decoder
- UUID Generator (v4)
- Unix Timestamp Converter
- Secret Santa Generator
- Profit Margin & Markup Calculator
- QR Code Generator
- Random Password Generator
- Percentage Calculator
- Color Converter (HEX, RGB, HSL)
- Color Palette Generator
- Aspect Ratio Calculator
- Lorem Ipsum Generator
- Word & Character Counter
- Case Converter
- Character Counter