Regex Tester

Test regular expressions with live match highlighting and capture groups.

  • No upload
  • Browser-based
  • Free
  • No signup
  • Text

Matches

    Common patterns (click to insert)

    Runs in your browser. Your text never leaves your device.

    How to use Regex Tester

    1. Type a regex pattern into the top field — no need to add /.../ delimiters.
    2. Toggle the flags you need (g, i, m, s, u) with the checkboxes.
    3. Paste your test text below. Matches highlight in yellow in real time.
    4. Below the highlighted text, each match is listed with its capture groups ($1, $2, …) and starting index.
    5. Click a common pattern in the 'Common patterns' section to prefill (email, URL, phone, date, HEX color, IPv4).

    Common use cases

    • Form input validation. Write and test a regex for phone numbers, postal codes, or email before dropping it into your React/Vue form validator.
    • Log line parsing. Paste a chunk of nginx or application logs and iterate on a regex until it extracts the fields you need. Named groups (?<field>…) work here.
    • Bulk text replacement. Confirm your search pattern matches only what you intend before running a find-and-replace across a codebase.
    • Data extraction. Test regex-based scraping patterns before running them against thousands of pages in your ETL pipeline.

    Tips

    • Always use the 'u' flag when your text contains Turkish, emoji, or any non-ASCII characters. Without it, character classes like \w may miss letters.
    • Prefer non-greedy quantifiers (*?, +?) for HTML/tag matching — greedy quantifiers over-match aggressively.
    • Anchors ^ and $ default to string start/end. With the 'm' flag, they match line start/end instead.
    • Common gotcha: . does not match newline by default. Add the 's' flag to match multi-line text.

    Troubleshooting

    'Invalid regex' error on \d.
    In JSON or code strings, backslashes must be doubled: use \\d. In this tool's input field, single backslash is fine.
    No matches even though I see the text.
    Character encoding may differ. Copy the target text back into the pattern with word boundaries removed to see if it matches without \b.

    What to try next

    Frequently asked questions

    Is my regex pattern or test text sent anywhere?
    No. Everything runs in your browser via the native RegExp engine — nothing is sent to a server.
    Which regex dialect does it use?
    JavaScript's built-in RegExp (ECMAScript). This is the same engine used by Node.js, browsers, and most JavaScript tools.
    What do the flags mean?
    g = find all matches, i = case-insensitive, m = ^/$ match line breaks, s = . matches newline, u = full Unicode support.
    Can I see capture groups?
    Yes — each match lists its numbered capture groups ($1, $2, …) below the match text.