Regex Tester
Test regular expressions live — match, group and replace with instant feedback.
What is a Regular Expression?
A regular expression (regex or regexp) is a sequence of characters that defines a search pattern. Regexes are used throughout software development for input validation, string parsing, find-and-replace in text editors, and log analysis. This tester uses JavaScript's built-in RegExp engine, so patterns are directly compatible with Node.js, browser JavaScript, TypeScript, and frameworks that run on the V8 engine.
Flags
Toggle flags using the buttons above the test string. The most common flags are g (find all matches rather than stopping after the first), i (case-insensitive matching) and m (multiline — makes ^ and $ match the start and end of each line rather than the whole string). The s (dotAll) flag makes . match newline characters, which is useful when parsing multi-line blocks.
Named Capture Groups
Use the syntax (?<name>...) to create a named capture group. Named groups are displayed as labelled badges below each match, making complex patterns much easier to understand at a glance. In the Replace tab, reference groups with $<name> or by index with $1, $2, etc.
Replace Mode
Switch to Replace mode to see the transformed output as you type. The replacement string supports all JavaScript back-references: $& (whole match), $1–$9 (numbered groups), and $<name> (named groups). This is ideal for batch renaming, reformatting dates, or extracting structured data from logs.
Related Tools
- JSON Formatter & ValidatorValidate, format and minify JSON — with syntax error highlighting.Open tool
- JWT DecoderDecode and inspect JWT token headers, payloads and signatures.Open tool
- HTML Entity EncoderEncode and decode HTML entities for safe use in markup.Open tool
- HTTP Status CodesReference list of all HTTP status codes with explanations.Open tool