Regex Tester
Test JavaScript regular expressions against sample text and list every match with its position and capture groups.
Runs on your device
Result
What it does
Write a pattern, set flags, and see exactly what it matches. Results show the index of each match and its numbered groups, which makes off by one and greedy quantifier mistakes easy to spot.
How to use it
- Enter the pattern without surrounding slashes.
- Add flags such as i or m.
- Paste test text and read the match table.
Example
The example fills in realistic values and runs the tool. Select Try an example above to see it.
When it helps
- Building validation patterns.
- Extracting fields from log lines.
- Learning regex syntax interactively.
Questions
Which regex flavour is used?
JavaScript (ECMAScript), as implemented by your browser. Lookbehind and named groups work in all current browsers.
Why is the g flag always applied?
So that every match is listed. It does not change what an individual match looks like.
Can a pattern freeze the page?
Patterns with catastrophic backtracking can be slow. Results are capped at 1,000 matches; if typing becomes sluggish, simplify nested quantifiers.
More developer tools
See all 25- JSON to CSV Converter Convert a JSON array of objects into a CSV file. Nested objects become dot notation columns and formula like cells are neutralised for spreadsheets.
- CSV to JSON Converter Parse CSV (quoted fields, embedded commas and line breaks included) into a JSON array, using the header row as keys and optional type inference.
- HTML Entity Encoder & Decoder Escape text for safe use inside HTML, encode every non-ASCII character as a numeric entity, or decode named and numeric entities back to text.
- Diff Checker Compare two texts line by line and see exactly which lines were added or removed, with an option to ignore whitespace changes.
- Cron Expression Explainer Translate a five field cron expression into plain English and list its next scheduled run times in your local time zone.
- Number Base Converter Convert integers of any size between binary, octal, decimal, hexadecimal and base 36 using exact BigInt arithmetic.
People also use
Browse all 200 tools- Keyword Density Checker Count how often words and two- or three word phrases appear in your copy and check the density of a target keyword, to catch stuffing or missing topics. SEO
- World Clock See the current time in New York, London, Dubai, Tokyo and any other city at a glance, with daylight saving handled automatically. Time & productivity
- Water Intake Calculator Estimate how much water to drink each day from your weight, exercise and climate, in litres, glasses and ounces. Health & fitness
- Markdown to HTML Converter Convert GitHub flavoured Markdown (tables, task lists, fenced code) into clean HTML you can paste into a CMS or email template. Text & writing