Enter a regex pattern
Add JavaScript regex syntax without enclosing slash characters.
JavaScript regex utility
Test regular expressions as you type, highlight matches, inspect numbered and named capture groups, and preview JavaScript replacements without sending your text to a server.
Enter the pattern without enclosing slash characters. 50 / 2,000 characters.
48 / 200,000 characters
Testing regular expression…
Contact [email protected] or [email protected]
Complete matches, positions, and capture groups will appear here.
Uses JavaScript replacement syntax, including $&, $1, and named group references.
Evaluation happens in a local worker. Tests taking longer than 750 ms are stopped; no timeout can guarantee that every pathological pattern is safe.
Add JavaScript regex syntax without enclosing slash characters.
Paste the exact kind of content you expect the expression to inspect.
Enable global, case-insensitive, multiline, dotAll, Unicode, or sticky behavior as needed.
Check highlighting, zero-based positions, complete matches, captures, and replacement output.
A regular expression is a compact pattern for finding text with shared structure. It can locate exact words, repeated characters, boundaries, optional parts, or groups that you want to extract. A successful syntax check does not prove that a broad real-world format—such as every valid email address—is fully validated.
g finds successive matches, i ignores applicable letter case, m changes line-anchor behavior, and s lets a dot include line terminators. JavaScript also provides u for Unicode-aware parsing and y for matching only at the current lastIndex.
Parentheses create numbered captures, while syntax such as (?<domain>...) creates a named capture in supported JavaScript engines. The tester lists both alongside each complete match.
Replacement mode uses JavaScript string replacement rules. Use $& for the complete match, $1 for the first numbered group, and $<name> for a named group.
The included email, URL, IPv4, number, color, whitespace, date, and username patterns are practical test data. They intentionally remain understandable and are starting points—not standards-complete validators or security rules.
A regex tester runs a regular expression against sample text so you can inspect matches, positions, capture groups, and replacement output before using the pattern in code.
Enter a pattern without surrounding slashes, paste test text, and select any flags. ToolsWeave evaluates changes automatically, or you can use Test regex.
This tool uses the JavaScript regular expression engine in your browser. PCRE, Python, .NET, and Java have syntax and behavior differences, so patterns are not guaranteed to transfer unchanged.
The g flag continues searching after the first match. Without g or the sticky y flag, the JavaScript exec operation returns only the first match.
The i flag makes applicable letter comparisons case-insensitive, so a pattern such as hello can match HELLO.
Parentheses capture part of a complete match. Numbered and named captures appear in the match details and can be referenced in JavaScript replacement text.
Yes. Enter replacement text using JavaScript syntax such as $&, $1, or $<name>; the replacement result updates with the test.
No. Patterns, flags, replacement text, and test strings are evaluated in a local browser worker and are not included in analytics.
Browse the Developer Tools collection or see all ToolsWeave tools.