Quick Patterns:
//
g Find all matches
Test String246 chars
Match Preview
Hello World! My email is alice@example.com and bob@test.org
Visit https://www.example.com or http://test.io for details.
Phone: +91 9876543210, Date: 2024-12-25, Color: #ff5733
UUID: 123e4567-e89b-12d3-a456-426614174000
#javascript #regex #webdev
Enter a pattern above to see matches.

What is Regex Tester?

A regular expression (regex or regexp) is a sequence of characters that defines a search pattern. Regex is used in virtually every programming language and text editor for finding, replacing, and validating text: email and phone number validation, log file parsing, data extraction from unstructured text, find-and-replace operations, URL routing, and input sanitisation.

Writing regular expressions is notoriously difficult — the syntax is dense, the rules for character classes, quantifiers, and lookaheads are non-obvious, and debugging a failing pattern requires testing against many cases simultaneously. A visual regex tester solves this problem by showing you exactly what a pattern matches in real time, highlighting captures in different colours, and explaining what each part of the expression does.

Altairys's Regex Tester supports JavaScript's regex engine with all flags (g, i, m, s, u, y). It highlights all matches in the test string, shows capture groups in a structured table, displays match positions (index and length), and provides a real-time explanation of your pattern. Whether you're writing validation code, parsing log files, building a search feature, or learning regex for the first time, this tool makes the process visual, fast, and educational.

How to Use Regex Tester

  1. Enter your pattern

    Type your regular expression in the regex input field (without enclosing slashes).

  2. Set flags

    Enable flags: g (global), i (case-insensitive), m (multiline), s (dotAll) as needed.

  3. Enter test text

    Type or paste the text you want to test your regex against.

  4. Review matches

    Matched text is highlighted in the test string; capture groups shown in a separate panel.

Key Benefits

Visual match highlighting

Matches and capture groups are colour-highlighted directly in the test string.

Capture group table

All capture groups and their values are displayed in a structured table.

Real-time testing

Results update instantly as you modify the pattern or test string.

Pattern explanation

Learn what each part of your regex does with built-in pattern descriptions.

Frequently Asked Questions

JavaScript's built-in RegExp engine, which follows the ECMA-262 standard. This is the same engine used in Node.js and all modern browsers.

The g (global) flag makes the regex find all matches in the test string instead of stopping at the first one. Without g, only the first match is returned.

A basic email pattern: /^[\w.+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}$/. Paste it into this tool and test it against various email addresses.

Parentheses in a regex create capture groups — they extract specific portions of the match. For example, /(\d{4})-(\d{2})-(\d{2})/ captures year, month, and day from a date string.

Yes — enable the m flag for multiline mode, where ^ and $ match the start and end of each line instead of the entire string.

Related Tools