What Does the Regex Tester Do?
The Regex Tester lets you build and debug regular expressions with instant feedback. Type a pattern, set flags and paste a test string: every match is highlighted in place, and a detail table lists each match with its position, numbered capture groups and named groups. Invalid patterns show the engine's exact error message instead of failing silently.
The tester uses JavaScript's native regex engine, so what works here works identically in browsers and Node.js — and mostly transfers to PHP, Python and other PCRE-flavored engines.
How to Test a Regular Expression
- Enter your pattern (without surrounding slashes) — e.g.
\b\w+@\w+\.\w{2,}\b. - Set flags:
g(all matches),i(ignore case),m(multiline anchors),s(dot matches newline),u(unicode). - Paste sample text — matching runs live as you type.
- Read the highlights and the group table to verify captures.
Regex Quick Reference
\d \w \s— digit, word character, whitespace (capitals negate:\D= non-digit).+ * ? {n,m}— one-or-more, zero-or-more, optional, counted repetition.^ $ \b— start of line, end of line, word boundary.(…)capture group ·(?:…)non-capturing ·(?<name>…)named group.(?=…) (?!…)— lookahead / negative lookahead.[abc] [^abc]— character class and its negation.
Developers validate input patterns, data analysts extract fields from messy logs, and SEO specialists test redirect rules — all safer to debug here than in production.