Regex Tester

Test regex patterns and see matches live. Free, no signup.

/ /

How It Works

Enter a regular expression and flags (e.g. g for global, i for case-insensitive). Type or paste test text below. Matches are highlighted in real time as you type. The match count and individual matches are shown below.

What Are Regular Expressions?

Regular expressions (regex) are patterns used to match character combinations in strings. They are essential for text search, validation, parsing, and find-and-replace operations in programming, text editors, and command-line tools.

Regex Flags

Flags change how the pattern is applied. Combine them in the flags box, for example gi for a global, case-insensitive search.

FlagNameEffect
gGlobalFind all matches, not just the first
iIgnore caseMatch regardless of upper or lower case
mMultiline^ and $ match at each line break
sDotAll. also matches newline characters
uUnicodeTreat the pattern as Unicode code points
yStickyMatch only from the current index

Common Regex Tokens

TokenMatches
\dAny digit (0-9)
\wWord character (letter, digit or underscore)
\sWhitespace (space, tab, newline)
.Any character except newline
^ / $Start / end of the string or line
* + ?Zero or more, one or more, optional
{2,5}Between 2 and 5 repetitions
[a-z]Any character in the range a to z
(abc)A capturing group
a|ba or b

Frequently Asked Questions

How do I test a regular expression?

Type your pattern in the top field and add any flags (like g or i) in the small box beside it, then type or paste text into the test string area. Matches are found and highlighted live as you type, with a count and a list of each match and its position below.

Which regex flavor and flags does it support?

It uses the browser's built-in JavaScript (ECMAScript) regular expression engine, so any pattern valid in JavaScript works here. Supported flags include g (global), i (case-insensitive), m (multiline), s (dotAll), u (unicode) and y (sticky). Enter them together in the flags box, for example gi.

Does it show every match and where it is?

Yes. With the global flag g, every match in the text is highlighted, the total count is shown, and each match is listed with its exact character index. Without g, only the first match is found. Zero-length matches are handled without looping.

What happens if my pattern is invalid?

If the pattern cannot be compiled, an error message appears explaining what went wrong, and no matches are shown. Fix the pattern and the results update immediately, so you can debug a regex step by step.

Is the regex tester private and free?

Yes. It is completely free with no signup, and the pattern and test text never leave your browser. All matching runs on your device with JavaScript, so nothing is uploaded to a server.