MrHimanshu.comAlways ready to work
Let’s talk

CODE / PATTERNS

Regex Tester

Test JavaScript regular expressions against sample text with live match highlighting and capture groups.

Free · runs in your browser

2 matches

Write to ada@example.com or grace@example.com today.
  1. ada@example.com at 9 · groups: adaexample
  2. grace@example.com at 28 · groups: graceexample

Runs entirely in your browser. Nothing you enter is sent anywhere.

How to use Regex Tester

  1. Enter your pattern and any flags (g, i, m, s, u).
  2. Paste the text to test it against.
  3. Matches are highlighted and listed with their capture groups.

Reading a regular expression

A regular expression describes a pattern of text. \d matches a digit, \w a letter, digit or underscore, \s whitespace, . almost any character, + means one or more, * zero or more, ? optional, and brackets such as [a-z] match one character from a set. Parentheses capture the matched part so you can use it later.

The default example, (\w+)@(\w+)\.com, captures the name and the domain of simple addresses.

Flags and cautions

g finds every match instead of the first, i ignores upper and lower case, m makes ^ and $ work on each line, s lets . match a new line, and u enables full Unicode matching. The tester uses the JavaScript engine, and other languages differ in small details.

Patterns with nested repetition such as (a+)+ can take extremely long on some inputs. Test with realistic samples, and do not rely on a regular expression alone to validate email addresses.

Frequently asked questions

Which regex flavour is this?

The JavaScript (ECMAScript) flavour built into your browser, so results match what JavaScript code will do.

Why does my pattern freeze the page?

Patterns with nested repetition can backtrack catastrophically on some inputs. Simplify the pattern or shorten the text.

Is my text uploaded?

No. Matching runs locally in your browser.

All 9 in Developer toolsBrowse all 38 free tools