Regex Tester

How Regex Testing Works

Enter a regex pattern and test it against sample text in real-time.

  1. 1

    Enter your regex pattern

    Type your regular expression pattern with optional flags (g, i, m, s, u, y).

  2. 2

    Enter test text

    Provide the text you want to test against in the test area.

  3. 3

    See matches highlighted

    All matches are highlighted in the test text, with a detailed list showing each match value, index, and capture groups.

FAQ

What is a regular expression?
A regular expression (regex) is a sequence of characters that defines a search pattern. It is used for string matching, validation, and text manipulation.
What do the regex flags mean?
g (global) finds all matches; i (ignore case) makes matching case-insensitive; m (multiline) makes ^ and $ match line boundaries; s (dotall) allows . to match newlines; u (unicode) enables full Unicode support; y (sticky) matches only at the current position.
What are capture groups?
Capture groups are portions of a regex enclosed in parentheses. They let you extract specific parts of a match. For example, (\d{4})-(\d{2})-(\d{2}) captures year, month, and day separately from a date string.
How do I test my regex?
Enter your pattern in the input field, optionally add flags, then type or paste test text. Matches are highlighted in real-time and listed with their positions and capture groups.

Related Tools