Regex Tester
Test a JavaScript regular expression against sample text, see every match with its position and capture groups, and get real errors for invalid patterns.

A regex tester runs a regular expression against sample text and highlights every match and capture group as you type. It uses the browser's native JavaScript engine, so what you see is exactly what your JavaScript code will do.
Runs entirely in your browser · no signup · nothing is uploaded · updated 2026-08-29
How to use it
- 1.Enter your pattern and toggle the flags you need.
- 2.Paste text to test it against.
- 3.Matches, positions and capture groups update as you type.
Frequently asked questions
Which regex flavour is this?
JavaScript's, via the native RegExp engine. Most syntax is shared with PCRE, but lookbehind, named groups and unicode property escapes differ in support across languages.
What does the g flag change?
Without it, only the first match is returned. With it, the engine continues from the end of each match. It is the flag people forget most often.
Why does my pattern hang the page?
Catastrophic backtracking - nested quantifiers like (a+)+ against a long non-matching string. We cap the match loop, but the real fix is to rewrite the pattern to avoid ambiguity.
Do I need to escape forward slashes?
Not here - you are entering the pattern body without delimiters. In a JavaScript literal you would need to escape them.
Why does my regex work here but not in Python?
Flavour differences. JavaScript has no lookbehind in older engines, no atomic groups, and different Unicode property syntax. Test in the flavour you will ship in.
What is the difference between greedy and lazy matching?
Greedy quantifiers like .* take as much as possible then backtrack; lazy ones like .*? take as little as possible then expand. For matching inside delimiters, lazy is almost always what you want.
How do I match across multiple lines?
The m flag makes ^ and $ match at each line boundary. The s flag makes . match newlines. They are different things and you often need both.
Should I parse HTML with regex?
No. HTML is not regular and any pattern that appears to work fails on nested or malformed markup. Use DOMParser in the browser or a real parser on the server.
The guide behind this tool
Cron expression cheatsheet with the mistakes that bite
Every cron field explained with worked examples, plus the off-by-one and timezone mistakes that quietly break scheduled jobs.
Regex cheatsheet: the patterns you actually need
Every regex construct worth memorising, the JavaScript-specific gotchas, and the ambiguity that makes a pattern hang the whole page.
Tools that pair with this one
JWT Decoder
Paste a JSON Web Token to decode its header and payload and read every claim, including expiry. Runs entirely in your browser.
JSON Formatter
Format, validate and minify JSON in your browser. Get the exact line and column of a syntax error instead of a vague parse failure.
UUID Generator
Generate cryptographically random UUID v4s, or time-ordered UUID v7s that index far better as database primary keys.
Base64 Encode / Decode
Encode text to base64 or decode it back, with full UTF-8 support and automatic handling of base64url input. Runs entirely in your browser.
Built something?
RankCert is a weekly launch board where products rank on domain control we verify ourselves - not upvotes. Listing is free and the link is dofollow whether or not you display our badge.