Text

Regex Tester

Test JavaScript regular expressions against sample text.

Runs in your browser
Common flags
Results Ready
0 matches


            

About Regex Tester

Regex Tester runs JavaScript regular expressions against sample text and highlights matches, capture groups, and flags for quick pattern iteration.

Common uses

  • Test a validation pattern before adding it to code.
  • Explore how global and case-insensitive flags change matching.
  • Check capture groups against realistic log or input samples.

Good to know

JavaScript regular expressions can behave differently from regex engines in other languages, so retest patterns in the runtime that will use them.

How to test a pattern

Use realistic examples that include both matching and non-matching text. A regex that works for one happy-path string can fail when whitespace, casing, punctuation, or line breaks change.

JavaScript regex behavior

This page uses browser JavaScript regular expressions, so flags, lookbehind support, Unicode handling, and escaping rules should be compared with the runtime where the pattern will be deployed.

Common mistakes

Overly broad patterns can match text you did not intend. Add anchors, character classes, and sample failures to make validation patterns easier to trust.

Before you rely on the output

  • Retest patterns and comparisons in the final runtime when whitespace, line endings, locale, or regex-engine differences can change the result.
  • Privacy mode: inputs are processed locally in your browser and are not intentionally sent to an application server.

Related tools

Text Diff

An unhandled error has occurred. Reload x