How it works
The Regex Tester is an interactive regular expression playground where you write a pattern, paste test text, and see matches highlighted in real time. It supports full JavaScript regex syntax including all flags, capture groups, named groups, lookaheads, and lookbehinds.
Regular expressions are one of the most powerful and most error-prone tools in a developer's toolkit. A regex that works on your test string can silently fail or incorrectly match on edge cases — the Regex Tester makes the behavior visible before you ship code that depends on it.
How to use it: enter your regex pattern in the top field (without the surrounding slashes), select flags (g for global, i for case-insensitive, m for multiline, s for dotAll, u for Unicode), and paste test text below. Matches are highlighted inline — green for full matches, different colors for capture groups. Match details (position, captured groups, named groups) are shown in the sidebar.
Pattern library: the tool includes a searchable library of common regex patterns — email, URL, IP address, date formats, phone numbers, credit card numbers, UUID, HTML tag — as starting points that you can adapt.
Key flags explained: g (global) finds all matches, not just the first. i makes matching case-insensitive. m makes ^ and $ match line boundaries, not just the start/end of the string. s makes . match newlines. u enables full Unicode mode. The tester shows how each flag changes the match results interactively.
Why run this locally: your test strings may contain sensitive data — internal identifiers, email addresses, API response samples, PII. The Regex Tester processes everything client-side with no server request.
Frequently Asked Questions
- g (global — find all matches), i (case-insensitive), m (multiline — ^ and $ match line boundaries), s (dotAll — . matches newlines), u (Unicode mode), and y (sticky). Combinations like gi and gim are supported.
- Each capture group match is shown in a different highlight color in the text, and the sidebar shows the matched text for each group (&1, $2, etc.) and named groups (?<name>) alongside their values.
- Yes. The tool shows match execution time in milliseconds. Patterns that cause exponential backtracking on long inputs will show very high times — a signal that the regex needs to be rewritten for safety.
- Yes. JavaScript supports positive and negative lookaheads (?=...) and (?!...) in all browsers. Lookbehinds ((?<=...) and (?<!...)) are supported in all modern browsers (Chrome, Firefox, Safari 16.4+, Edge).