Regex Tester
Enter a regex pattern and test string to see all matches highlighted in real time. Supports capture groups, substitution, and all standard JavaScript flags.
How to use this tool
- Type or paste a regular expression into the Pattern field (e.g. \d+ to match numbers).
- Enter the text you want to test in the Test String area — matches will be highlighted immediately.
- Toggle flags (g, i, m, s) to change how the pattern matches across the text.
- Switch to the Substitution tab to enter a replacement string and preview the result live.
- Click Copy Share URL to share your regex and test string with others via a direct link.
Why use our Regex Tester?
Regular expressions are one of the most powerful tools in a developer's toolkit, but getting them right can be tricky. Our Regex Tester lets you experiment with patterns in real time, see exactly which characters match, inspect individual capture groups, and preview substitutions — all without leaving the browser. Nothing is sent to a server: your patterns and test data stay private.
Frequently Asked Questions
What does the ^ mean in regex?
The caret ^ anchors the match to the start of the string (or the start of a line when the multiline flag m is enabled). For example, ^Hello matches 'Hello' only when it appears at the very beginning.
How do I match a literal dot?
In regex, an unescaped dot . matches any character. To match a literal dot, escape it with a backslash: \. — for example, \d+\.\d+ matches a decimal number like 3.14.
What is a capture group?
A capture group is a part of a pattern wrapped in parentheses, e.g. (\w+). When the pattern matches, the content matched by each group is extracted separately. Groups are numbered from left to right starting at 1, and you can reference them in substitutions with $1, $2, etc.
What regex flavour does this tool use?
This tester uses the native JavaScript RegExp engine built into your browser. It supports all standard ECMAScript regex features including lookahead, lookbehind (in modern browsers), named groups, and Unicode mode.
What do the flags g, i, m, and s do?
g (global) finds all matches instead of stopping after the first. i (ignore case) makes the match case-insensitive. m (multiline) makes ^ and $ match the start and end of each line. s (dotAll) makes the dot . match newline characters as well.
Related Tools
Base64 Encoder / Decoder
Encode and decode Base64 text quickly and easily.
Cron Expression Builder
Build, test, and understand cron expressions with a visual builder and next run times.
Hash Generator
Generate MD5, SHA-1, SHA-256 and SHA-512 hashes from text or files in your browser.
JSON Formatter
Format and validate JSON instantly for development and debugging.
Recently Visited Tools
Social Media Image Resizer
ImageResize and crop images to the exact size for Instagram, YouTube, X, Facebook, LinkedIn, TikTok, and Pinterest with one-click presets.
SERP Snippet Preview
DeveloperPreview how your title tag and meta description render in Google, with live pixel-width limits for desktop and mobile.
SEO Meta Analyzer
DeveloperAnalyze title tags, meta descriptions, Open Graph tags, Twitter Cards, and social previews from any public URL.