Regex Tester

Test regular expressions instantly against your own text. Type a pattern, tick the flags you need, and see every match highlighted with its position — all in your browser.

How to Use

  1. Type your regular expression in the pattern box.
  2. Tick the flags you need — global to find all matches, case-insensitive to ignore case.
  3. Paste your test text and click Test to see every match highlighted.
  4. Use Clear to reset the pattern, flags and text.

Key Features

  • Instant highlighting — every match is highlighted in the preview with its position shown.
  • Flag control — toggle g, i, m and s flags individually.
  • Safe patterns — invalid expressions show a clear error instead of failing silently.
  • Match positions — each match lists its starting index and matched text.
  • Private — your pattern and text never leave your browser.

FAQs

Why do I get an error for my pattern?

The pattern is passed to the JavaScript regular expression engine. Characters such as backslashes and brackets have special meanings, so they must form valid regex syntax. Check the error message for a hint about where the problem lies.

What do the flags do?

The g flag finds every match instead of stopping at the first, i ignores upper and lower case, m makes start and end anchors work on each line, and s lets the dot match newline characters too.

Can I reuse my pattern elsewhere?

Yes — the pattern syntax works in any JavaScript environment and in most editors that support regular expressions.

Is my text sent anywhere?

No. All matching happens locally in your browser.

Related Tools

Word Counter · Case Converter · Text Reverser

Scroll to Top