FREE WEB TOOL

Regex tester online

Test JavaScript regular expressions with flag checkboxes, highlighted matches, indexes, capture groups, named groups, and replacement previews.

Use tool

🔒 Inputs are processed locally in your browser.

How to use this tool

Test JavaScript regular expressions with flag checkboxes, highlighted matches, indexes, capture groups, named groups, and replacement previews.

  1. Set Pattern, Flags, Test text.
  2. Use Test regex to process the input.
  3. Compare the result with your source data and return to the input to make corrections.

Input and settings example

Pattern
\b[A-Z][a-z]+\b
Flags
g
Test text
Alice met Bob in Tokyo.

What to know before using it

A pattern can match while still capturing the wrong substring. Highlighting, offsets, groups and replacement preview reveal those mistakes.

Common failure points

  • The g flag changes repeated matching behavior.
  • m changes anchors; s changes how dot treats line breaks.
  • Escape user-provided literals before embedding them in a pattern.

Practical example

For an email-like pattern, verify the captured domain rather than only checking that the full pattern matches.