Regex Tester

Test JavaScript regular expressions against a string with live highlighting.

Write a regular expression, set flags, and see matches highlighted in your test string in real time. Captured groups are shown beside each match. Uses the JavaScript regex engine for parity with browsers and Node.js.

Common use cases

  • Test patterns for form validation (email, phone, postcode) before shipping
  • Build regexes for log parsing and string extraction in JavaScript / Node
  • Debug an existing regex by stepping through which characters it matches
  • Verify capture groups extract the right substrings from sample input

Frequently asked questions

Which regex flavour does it use?
ECMAScript / JavaScript regex, identical to the engine in Chrome, Firefox and Node.js.
Why is my Python or PCRE regex not matching?
JavaScript regex doesn't support look-behind in older browsers and lacks named-group syntax variants. Adapt your pattern or use a server-side tool.
How do I match across multiple lines?
Add the m flag for multiline mode (^ and $ match each line) and the s flag for dotall (. matches newlines). Both are standard ECMAScript flags.

Related tools