Regex Tester

Enter a pattern and some test text to see every match highlighted, with capture groups listed below.

Free · Runs in your browser · Your text is never uploaded

A text with highlighted matches found by a pattern
Without the surrounding slashes.
g global, i ignore case, m multiline, s dot matches newline, u unicode

Using the tester

Type your pattern without slashes and set flags in the second box. Matches are highlighted in the test string and listed in a table with their position and any capture groups. The tester uses your browser’s JavaScript (ECMAScript) regular expression engine, so results match what RegExp does in JavaScript and Node.js. Other languages (Python, PCRE, Java) differ in some features such as lookbehind syntax and named groups.

Handy syntax

  • \d digit, \w word character, \s whitespace, . any character
  • + one or more, * zero or more, ? optional, {2,4} two to four
  • ( ) capture group, (?: ) non-capturing, | or
  • ^ and $ start and end of line (with the m flag)

Patterns with nested repetition such as (a+)+b can take exponential time on some inputs, so if the page slows down, simplify the pattern.

Frequently asked questions

Which regex flavor does this use?

JavaScript (ECMAScript), the same engine as your browser and Node.js.

What do the flags mean?

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

Why is my regex hanging the page?

Some patterns backtrack catastrophically on certain inputs. Avoid nested quantifiers like (a+)+ and make groups more specific.

Is my test data sent anywhere?

No. Matching runs entirely in your browser.