Skip to main content

Regex Tester

Test regular expressions with flags, captures, and replace.

100% client-side · no data leaves your browser

Replace

About this tool

Test regular expressions against a string with real-time match highlighting. Supports g, i, m, s flags, capture groups, and replacement strings with group references.

How to test a regular expression

Write and validate a regex against sample input with live match highlighting.

  1. 1

    Enter the pattern

    Type your regex (without the surrounding slashes) into the pattern field.

  2. 2

    Set the flags

    Toggle g, i, m, s, u, y flags as needed for your use case.

  3. 3

    Add test input

    Paste sample text below. Matches are highlighted and capture groups are listed.

  4. 4

    Optional: try a replacement

    Enter a replacement string (with $1, $2 references) to preview the result.