Regex Tester

Test regex matches against input text.

Reset

About the Regex Tester

This Regex Tester lets you try a regular expression against sample text and see what matches before you drop the pattern into code, analytics filters, or a CMS rule. Regex is powerful and easy to get wrong; testing live saves broken forms and silent validation bugs.

Enter a pattern, optional flags, and input text. Matches are shown so you can tighten or loosen the expression until it behaves the way you expect.

Common uses

  • Validating emails, slugs, order IDs, or phone-like strings in forms
  • Extracting product codes or tracking numbers from messy paste text
  • Building find/replace patterns for cleanups in logs or exports
  • Teaching or documenting a pattern before sharing it with a teammate

How to use

  1. Paste representative sample text into the input area (include edge cases).
  2. Type your regular expression and choose flags if needed (for example case-insensitive).
  3. Run the test and inspect which parts matched — and which did not.
  4. Adjust the pattern until false positives and false negatives disappear.

Tips that prevent pain

  • Start strict, then relax. Overly broad .* patterns often match too much.
  • Escape special characters when you mean them literally (., (, ), ?).
  • Test empty input, leading/trailing spaces, and unicode if your users paste from Word.

FAQ

Which regex dialect is this? Browser JavaScript regex. Patterns may differ slightly from PCRE/Python — re-test in your runtime before shipping.

Can regex parse HTML? Prefer a real HTML parser for documents. Regex is fine for small, controlled snippets only.