Regex Tester
Test regular expressions live with match highlighting, replace preview, and explanations.
Pattern
//g
Flags:
g Global — find all matchesi Case-insensitivem Multiline — ^ and $ match line boundariess DotAll — . matches newlinesu Unicode
Test Input
Regex Tester and Regular Expression Checker
Write a regular expression and test it instantly against your input. Matches are highlighted inline with match count and position details. Enable the replace tab to preview substitutions using capture group references.
The pattern explainer breaks down complex regex into human-readable descriptions of each token, helping you understand what your expression actually matches.
Frequently Asked Questions
- What regex flavour does this tool use?
- The regex tester uses the JavaScript RegExp engine built into your browser. Most common regex patterns work, but some flavours (PCRE lookbehind of variable length, atomic groups) may differ.
- What flags are supported?
- g (global), i (case-insensitive), m (multiline), s (dotAll), u (unicode), and d (indices). Combine flags like "gi" for case-insensitive global matching.
- How does the replace preview work?
- Enter a replacement string in the Replace field. Use $1, $2, etc. to reference capture groups, and $& for the full match. The preview updates live.
- What does the regex explanation show?
- The explanation breaks down your regex pattern into individual tokens (anchors, metacharacters, quantifiers, groups) and describes what each part matches.