WebTool

Regex Tester

Free online regex tester: real-time match highlighting, capture groups, all g/i/m/s/u/y flags and a syntax cheatsheet.

Privacy: all processing happens locally in your browser. Your input never leaves your device.

What is Regex Tester?

The worst way to learn a regex is wrong is discovering it in production. Enter a pattern and test text here and every match is highlighted in real time with capture groups listed one by one. All g/i/m/s/u/y flags are supported and a syntax cheatsheet is attached. It runs on the browser's native RegExp engine (behaving exactly like JavaScript) with protection against zero-width infinite loops.

How to Use

  1. Enter a regular expression and flags
  2. Paste the test text
  3. Review highlighted matches and capture groups

FAQ

Why does . not match line breaks?
By default . does not match \n; enable the s flag (dotAll) to match any character including newlines.
Greedy vs non-greedy?
Matching is greedy by default (as much as possible); adding ? after a quantifier makes it non-greedy: <.+> matches a whole line, while <.+?> stops at the first >.
Does this regex syntax apply to other languages?
This is the JavaScript dialect, largely similar to PCRE; advanced features like named groups and lookbehinds vary in support across languages.

Related Tools

Last updated 2026-09-04