Skip to main content

Regex Tester – Test Regular Expressions Online

Test JavaScript regular expressions with live match highlighting, capture groups, replace preview, and g, i, m, and s flags.

Regex Tester

Test, inspect, and replace regular expressions

//g
Enter a pattern above, or use.
Regex quick reference

What is Regex Tester?

Interactive regex tester with live match highlighting, capture group display, replace preview, JSON/CSV match export, and shareable URL state. Supports g, i, m, and s flags.

  • regex
  • regular expression
  • pattern matching
  • validation
  • developer

Features

What you get with Regex Tester.

  • Real-Time Highlighting

    Matches are highlighted as you type your pattern.

  • Capture Groups

    Displays each group's value and index.

  • Replace Preview

    Test replacement strings with backreferences.

  • Supported JS Flags

    Toggle g, i, m, and s flags.

How to use Regex Tester

Follow these steps to get the best results.

  1. Enter your pattern and flags

    Type a regular expression and toggle the flags you need (g, i, m, s).

  2. Add your test string

    Matches are highlighted live and each capture group's value is listed.

  3. Preview a replacement

    Switch to the Replace tab, enter a replacement string, and see the result before using it in code.

Advertisement

In-feed adResponsive

Frequently asked questions

Common questions about Regex Tester.

Check: (1) missing 'g' flag for multiple matches, (2) 'i' flag for case-insensitive matching, (3) escaped special characters like \. instead of ., (4) 'm' flag for multiline strings.

Comments

Share feedback, ask questions, or help others use this tool.

Join the discussion

Sign in to comment, reply, and report inappropriate content.

Advertisement

Mobile banner adResponsive