Regex Tester — Test & Debug Regular Expressions Online
This free regex tester lets you build and debug regular expressions against your own text, highlighting matches in real time. It uses the JavaScript RegExp engine and supports flags for global, case-insensitive, multiline, and dotall matching, plus capture groups and named groups. It helps you reason about greedy versus lazy quantifiers — the most common source of over-matching — so your pattern catches exactly what you intend. Test against valid and deliberately malformed input. Everything runs in your browser, so your text is never uploaded.
How the regex tester works
Regular expressions (regex) are patterns used to match, search, and manipulate text. This tester uses JavaScript's native RegExp constructor, making it directly compatible with any JavaScript code. Enter your pattern (without delimiters) and optional flags in the dedicated field.
Key flags: g (global — find all matches, not just first), i (case-insensitive), m (multiline — ^ and $ match line starts/ends), s (dotAll — . matches newlines too). Common patterns: \d+ matches one or more digits, \w+ matches word characters, ^ anchors to line start, $ to line end, [a-z] matches a character range, (group) captures a group. Matches are highlighted in the test string and all capture groups are shown. The tester is client-side — no input leaves your browser, making it safe to test patterns against sensitive data.