Home / Developer Tools / Regex Tester

Regex Tester

Test regular expressions live with matches and groups.

How to use

  1. Enter your pattern and flags.
  2. Paste test text.
  3. Matches and groups update live.

Frequently asked questions

Which regex flavor?

JavaScript (ECMAScript) - what runs in browsers and Node.js.

Why is my pattern erroring?

Unescaped special characters are the usual cause - escape . ( ) [ ] with a backslash to match them literally.

Test regular expressions as you type

Regular expressions are powerful and famously easy to get subtly wrong. This tester shows you exactly what your pattern matches against sample text in real time - every match highlighted, capture groups broken out - so you can build a pattern by watching it work instead of guessing. It runs entirely in your browser, meaning the log files, user data or scraped text you paste as test input never leave your machine.

Flags, groups and the details that trip people up

Toggle the common flags and see their effect live: global (find all matches, not just the first), case-insensitive, and multiline (so ^ and $ match at line breaks). Named and numbered capture groups are listed for each match, which is the fastest way to confirm you're extracting the right piece. The classic gotchas show up immediately - a greedy .* swallowing more than intended, an unescaped dot matching any character, or a missing anchor letting a pattern match mid-word.

Because it uses the JavaScript regex engine, what you test here behaves exactly as it will in JS and Node code. Most syntax is shared with other languages, though lookbehind and some Unicode features vary by platform.

Build patterns incrementally

The reliable way to write a tricky regex is to start broad and tighten: match too much, then add constraints until only the right text is caught, checking the highlights at each step. Keep a few representative edge cases in your sample text - the empty value, the weird formatting, the line that shouldn't match - so you catch false positives early. Once the pattern is right, our other developer tools (JSON Formatter, timestamp and hash generators) are a click away for the rest of the job.

Related tools

  • Cron Generator — Build cron expressions with presets and plain-English descriptions.
  • Unix Timestamp Converter — Convert Unix timestamps to dates and dates to timestamps.
  • Unix Timestamp Generator — The current Unix timestamp, live and one click to copy.
  • MIME Type Lookup — Find the MIME type for any file extension, and vice versa.
  • HTTP Status Lookup — What every HTTP status code means, searchable.
  • Color Converter — Convert colors between HEX, RGB and HSL with live preview.

See all developer tools