MADE TO BE USEFUL. A growing collection of free tools for everyday work.
DEVELOPER TOOL / REGEX

Free Online Regex Tester

Test and debug regular expressions with live match highlighting. See every match, capture group and named group as you type, and preview replacements before you use them in code.

Uses JavaScript regular expression syntax, run safely in your browser with a time limit to catch runaway patterns.

✓ Free to use · No signup required · Processed in your browser
Regex Tester workspace
WRITE A PATTERN · ADD TEST TEXT · SEE MATCHES · TRY A REPLACEMENT
● READY TO USE
//
Invalid pattern.
Type a pattern and a test string — matches highlight as you type.
REGEX TESTER WORKSPACEMOSANKIT / DEVELOPER TOOLS
THE BASICS

What Is a Regex Tester?

A regular expression (regex) is a compact pattern for finding and extracting text. A regex tester lets you try a pattern against sample text and instantly see what it matches, so you can fix it before it goes into your code.

This tester uses the JavaScript regex engine — the same one used by browsers and Node.js — and highlights every match along with its capture groups.

BUILT FOR THE JOB

Key Features of MoSanKit Regex Tester

◎

Live Match Highlighting

Matches are highlighted in your test text as you type, with alternating colours so neighbouring matches are easy to tell apart.

()

Capture Groups

See numbered groups and named groups (?<name>…) for every match, including groups that did not take part.

⚑

Flags You Can Toggle

Switch global, ignore case, multiline, dotAll and unicode on and off with a click.

↺

Replace Preview

Try a replacement string with $1, $& or $<name> and see the result before using it.

⚠

Runaway Protection

Patterns that take too long are stopped with a clear warning, so catastrophic backtracking cannot freeze your tab.

◈

Clear Error Messages

Invalid patterns show the exact problem instead of failing silently.

QUICK AND SIMPLE

How to Test a Regular Expression

01 / PATTERN

Enter your pattern

Type your regular expression between the slashes.

02 / FLAGS

Choose your flags

Tick the flags you need, such as g for all matches.

03 / TEST

Add your test text

Paste the text to search. Matches highlight instantly.

04 / REFINE

Review and refine

Check groups and the replacement preview, then copy your pattern.

MADE FOR EVERYDAY WORK

Who Can Use This Tool?

DevelopersBuild and debug patterns before adding them to code.
QA EngineersValidate input rules and log filters.
Data AnalystsExtract and clean fields from messy text.
SEO SpecialistsWrite redirect and URL-matching rules.
System AdminsCraft patterns for log searches and config rules.
StudentsLearn regular expressions with instant feedback.
GOOD TO KNOW

A few things, answered.

Quick answers about using the MoSanKit Regex Tester.

JavaScript (ECMAScript). Most basic syntax is shared with other languages, but features such as lookbehind, named groups and flags can differ between flavours.

g finds all matches, i ignores case, m makes ^ and $ match at each line, s lets the dot match line breaks, and u enables full Unicode matching.

Some patterns, such as (a+)+$, can take exponential time on certain input. The tester stops after about a second and warns you, so you can make the pattern more specific.

Use $1, $2 for numbered groups, $& for the whole match and $<name> for named groups.

No. Matching runs in your browser, in a background worker.

Yes, to keep things fast: up to 200,000 characters and the first 1,000 matches.

Get your pattern right
before you ship it.

Explore more free developer tools from MoSanKit.

Explore All Tools ↗