Developer Utilities

Regex Tester

All tools

Try a pattern on real text, read what each token means, and check it for catastrophic backtracking.

How it works

Four simple steps

1

Enter pattern and flags

Type the regex and tick any of g, i, m, s, u and y.

2

Add test text

Paste lines that should match and lines that should not.

3

Read matches and tokens

Check the match table, groups and the plain-English token breakdown.

4

Review the ReDoS rating

Fix high or moderate warnings before the pattern meets user input.

Regex Tester

About Regex Tester

A signup form validated emails with a regex that passed every unit test, then a 40-character input pinned the API server for several seconds. Patterns like that usually hide a nested quantifier nobody noticed. Regex Tester shows the matches and points out risky structure in the same view.

Enter a pattern and toggle the g, i, m, s, u and y flags. The tester runs on your browser's JavaScript engine, so results match what Node.js and front-end code will do. A table lists each match with its index, numbered groups and named groups (up to 300 rows displayed), and a plain list of matches can be copied. Type a replacement such as

or
lt;name> to preview the substituted text. Underneath, every token in the pattern is explained in plain English, which helps when you inherit a regex from someone else.

The ReDoS panel is a structural check. It looks for nested quantifiers like (a+)+, stacked wildcards, overlapping alternations and similar shapes, then rates the risk as low, moderate or high. It never runs the pattern against a hostile input, so it can miss slow cases and works best as an early warning; load the Risky sample to see a high rating. When you only need a bulk find and replace, the regex replace tool is lighter, and the regex syntax cheat sheet is there for quick lookups.

Your pattern and test text are processed by the page itself. Sample data such as customer emails and order numbers is not sent to a server.

Keyboard shortcut

Ctrl Enter - Run tool

Use cases

Pattern iteration

Adjust groups and flags with instant highlight feedback.

Log parsing

Prove a line parser against messy production-shaped samples.

ReDoS awareness

Spot risky constructs before they land in hot validation paths.

Instructions

How to use this tool

FAQ

Frequently asked questions

See all FAQs

Answers for this tool. For site-wide help, open the FAQ hub.

JavaScript, because it runs on your browser's RegExp engine. Everyday syntax is shared, but possessive quantifiers and atomic groups do not exist in JavaScript, and lookbehind rules differ from PCRE and Python. Test again in the target language when the pattern is not for JavaScript.

Mostly a quantifier inside another quantified group, such as (\w+\s?)+$, or two alternatives that can match the same text. Against input that almost matches, the engine tries an exponential number of ways to split it. Collapsing the nesting or bounding repetition with {1,64} usually fixes it.

The g flag is off. Without it the engine returns only the first match, just like RegExp.exec in code, and the replacement preview changes only the first occurrence. Tick g to collect every match.

View more FAQs

Related tools

View all

Cron Calendar

Explain cron expressions and preview the next run times in any timezone.

Open

CSV to SQL

Infer column types and generate CREATE TABLE + INSERT statements from CSV.

Open

SQL Query Builder

Build SELECT queries visually and reverse-parse SQL into a structure tree.

Open

Log Pattern Miner

Cluster log lines into templates, surface anomalies, and mask PII locally.

Open

Explore 321 free tools

Everything you need as a developer, marketer or creator - in one beautiful place.

Browse all tools