Regex Tester

Free online regular expression tester. Write a regex pattern, paste your test string, and instantly see all matches highlighted with group captures. Supports all JavaScript regex flags (g, i, m, s, u). Runs entirely in your browser.

//g
Global
Test String
Enter a pattern and test string above

What is a Regular Expression (Regex)?

A regular expression (regex or regexp) is a pattern language for matching, searching, and manipulating text. A regex pattern describes a set of strings — for example, \d{3}-\d{4} matches US phone number fragments, and ^[a-z0-9.]+@\w+\.\w+$ roughly matches email addresses. Regex is supported in virtually every programming language and text editor.

Regular expressions are used for form validation (email, phone, credit card), extracting structured data from logs and text files, search-and-replace in code editors, URL routing in web frameworks, and text preprocessing in data pipelines. Despite a steep learning curve, mastering regex can save hours of manual string parsing.

This tester uses JavaScript's built-in RegExp engine — the same one used in Node.js and all modern browsers (ECMAScript 2023+). It supports named capture groups, lookaheads, lookbehinds, Unicode property escapes (\p{}), and the g, i, m, s, and u flags. Results are highlighted in real time as you type.

Frequently asked questions

What regex flavour does this tester use?

This tester uses JavaScript's built-in RegExp engine (ECMAScript 2023+ spec), which is the same engine used in Node.js and all modern browsers. It supports named capture groups, lookaheads, lookbehinds, unicode categories, and the s (dotAll) flag.

What do the regex flags mean?

The common flags are: g (global) — find all matches instead of stopping at the first; i (case-insensitive) — match regardless of upper/lower case; m (multiline) — make ^ and $ match line starts/ends instead of string start/end; s (dotAll) — make . match newlines as well; u (unicode) — enable full Unicode support including \p{} categories.

How do I test for multiline matches?

Enable both the g (global) and m (multiline) flags. With m enabled, the ^ anchor matches the start of each line and $ matches the end of each line, rather than just the start and end of the entire string.

What are capture groups and how do I see them?

Capture groups are portions of a regex pattern enclosed in parentheses — (pattern) — that capture the matched substring separately. Named groups use (?<name>pattern). The tester shows each match with its full match and any captured groups listed beneath it.

Why is my regex slow or freezing?

Slow regex is usually caused by catastrophic backtracking — a pattern like (a+)+ applied to a long non-matching string. The regex engine tries exponentially many combinations before giving up. Avoid nested quantifiers on overlapping groups. The tester applies a timeout to prevent the browser from freezing.

Does this regex tester store my patterns or test strings?

No. The tester runs entirely in your browser using JavaScript's native RegExp. Nothing is sent to any server. Your patterns and test strings remain completely private.

Try Sequel

Query your database in plain English.

Connect your database and get instant answers without writing SQL. Free for up to 3 seats — no credit card required.

Get started free