.*

Regex Tester pattern

Run a regular expression against sample text and inspect matches, counts, and capture groups.

pattern flags
INPUTtest text
0 lines 0 chars
1
MATCHESresults
Tool Guide

What this tool does

Regular expressions describe patterns to find within text. They are used for validation, log parsing, substitution, and data extraction, but writing a correct pattern on the first attempt is rare; most patterns are refined step by step against real data.

This tool applies the pattern to your sample text immediately and shows what matched, how many matches were found, and what each capture group contains. Flags for global search, case insensitivity, and multiline handling can be toggled.

Matching follows the JavaScript regular expression engine and runs in the browser, so neither the pattern nor the text is transmitted.

When to use it

Use it while building validation patterns for email addresses or phone numbers, while extracting fields from log lines, while preparing a find-and-replace pattern for an editor, or while working out what somebody else regular expression actually matches.

Input and output examples

Input Pattern [0-9]{3}-[0-9]{4}-[0-9]{4} against 010-1234-5678
Output 1 match: 010-1234-5678

The {3} quantifier requires exactly three repetitions.

Input Pattern (\w+)@(\w+)\.com against a@test.com
Output Full match a@test.com, group 1 a, group 2 test

Parentheses create capture groups whose values can be extracted separately.

Notes and limitations

Regular expression syntax varies between languages. This tool follows JavaScript, so some constructs may behave differently in PHP, Python, or Java, particularly lookbehind, Unicode property escapes, and named groups. Patterns with nested repetition can also degrade catastrophically on certain inputs, a denial-of-service risk known as ReDoS, so review performance for any pattern applied to user input on a server. Email validation in particular is hard to express fully; a simple check plus a confirmation email is the usual approach.

Frequently asked questions

It works here but not in my server code.

Engines differ between languages. This tool follows JavaScript, so confirm the syntax supported by your target language.

Only the first match is found.

The global flag is off. Enable it to find every match in the text.

Copied