离线模式
漫林
今日觉察
Free tools

Free Regex Tester

Type a pattern and some text: every match lights up as you type, with its capture groups in a table. Preview a replacement, read the pattern explained in plain words, or start from a ready-made pattern.

Open Regex Tester →

How to test a regular expression

Write a pattern

Type it between the slashes, or paste a /pattern/flags literal. Turn flags on and off with the buttons.

Add test text

Paste the text to search. Matches are highlighted as you type and listed with their groups.

Replace or explain

Preview a replacement, extract the matches with a template, or read what each part of the pattern does.

Manlin services

Make space for what matters

Use Manlin to reflect, plan and take your next step.

Manlin Life OS: a path from awareness to action

Regex Tester FAQ

Which regex flavor does it use?

JavaScript (ECMAScript), run by your browser’s own engine, so results match what your code does in the same browser or in Node.js. Other flavors such as PCRE, Python or Java differ in places: possessive quantifiers, atomic groups and inline comments are not available in JavaScript.

Is my text uploaded?

No. The pattern and the text are matched in your browser and never sent anywhere.

What happens with a pattern that never finishes?

Patterns such as (a+)+$ can take exponentially long on some text (catastrophic backtracking). Matching runs separately from the page and is stopped after 2 seconds, with a hint on how to fix the pattern, so the page never freezes.

How do I use capture groups in the replacement?

Write $1, $2 … for numbered groups, $<name> for named ones, $& for the whole match and $$ for a dollar sign. The preview updates as you type.

What does each flag do?

g finds all matches, i ignores case, m makes ^ and $ match at line breaks, s lets . match line breaks, u turns on Unicode mode, v adds Unicode sets, y matches only at the current position and d records group positions. Hover a flag button for its meaning.

Is there a limit?

Up to 10,000 matches are listed and highlighting covers the first 200,000 characters; replace, extract and the match count use the whole text. Texts up to 5 million characters are accepted.

Can I save my pattern?

Your last pattern, flags, text and replacement are kept in this browser and come back when you return.

More tools in this category

View all free tools →