Developer Tools
Free Online Regex Tester
Test a JavaScript regular expression against multiline text, inspect match positions and capture groups, and preview native-style replacements. Patterns and text stay in your browser.
Regex Tester is loading…
How to use Regex Tester
Enter a regular expression
Type a JavaScript regex pattern without slash delimiters, then select global, case-insensitive, multiline, dot-all, or Unicode flags. Invalid patterns are kept for editing.
Review matches and captures
Enter or paste multiline test text to highlight matches and inspect zero-based indexes, line and column positions, numbered captures, and named groups.
Preview a replacement
Enter replacement text to preview it against the original test text. JavaScript replacement tokens such as $&, $1, and $<name> are supported.
Frequently Asked Questions
Which regex syntax does the tester use?
+
The tester uses the JavaScript RegExp engine. Enter a pattern without surrounding slash delimiters and select supported flags separately: g, i, m, s, and u. Browser support for newer regex syntax may vary.
What do the regex flags mean?
+
Global (g) finds all matches; case-insensitive (i) ignores letter case; multiline (m) changes line-anchor behavior; dot-all (s) lets a dot match line breaks; Unicode (u) enables Unicode-aware matching.
How do I use capture groups in a replacement?
+
Use $& for the full match, $1 and later numbers for numbered captures, and $<name> for a named capture. A replacement preview never changes the original test text.
Can a regular expression make my browser unresponsive?
+
Some patterns can take a long time due to catastrophic backtracking. Matching runs in a separate browser worker that can be stopped after a limit, and the tool restricts pattern and text sizes. Complex patterns can still use significant resources before they are stopped.
Are the common regex examples complete validators?
+
No. Email-like, URL-like, date-like, and phone-number-like examples demonstrate pattern syntax only and do not cover every valid real-world value.
Are patterns or test strings sent to Udecode?
+
No. Pattern compilation, matching, highlighting, and replacement happen in your browser. Patterns and test text are not sent to Udecode or stored.
Explore more from Udecode
Explore more online tools and services from Udecode.