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
- Enter a regular expression and flags
- Paste the test text
- 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
Mock Data GeneratorFree online mock data generator: 13 field types (names, phones, emails, UUIDs, IPs), up to 1000 rows, JSON or CSV.Markdown EditorFree online Markdown editor: live side-by-side preview, GFM tables, task lists, code blocks, Mermaid diagram rendering and autosave.JavaScript Online RunnerFree online JavaScript runner: run code in an isolated sandbox iframe with live console capture and timeout protection.YAML Validator & FormatterFree online YAML validator and formatter: real-time checks with line-numbered errors, re-indent and JSON conversion.TOML Validator & FormatterFree online TOML validator and formatter: line-and-column error hints, normalized layout and JSON conversion — local.Code Diff & CompareFree online code compare tool with GitHub-style side-by-side view, inline character highlights and syntax highlighting.
Last updated 2026-09-04