tool
Regex Tester
Write a regular expression, test it against your text, and instantly see matches, capture groups, indexes
enter some test text to see matches
enter a regex to start testing
Tool Overview
Regular expressions are powerful, but debugging a pattern by repeatedly changing code and running it again can get tedious. This regex tester gives you a live environment for writing and testing JavaScript regular expressions. Enter a pattern, choose your flags, paste your test text, and immediately see which parts match.
What can you do?
- 1. Test regex patterns instantly
Enter a regular expression and test it against any text. Matches update immediately as you change the pattern, flags, or test content. - 2. Inspect every match
See each matched value along with its index, ending position, length, and captured groups. - 3. Test JavaScript regex flags
Toggle common JavaScript regular expression flags including global, ignore case, multiline, dotAll, Unicode and sticky matching. - 4. Preview replacements
Use the replacement panel to test JavaScript-style replacements and preview what your final text will look like. - 5. Start with common patterns
Load examples for emails, URLs, phone numbers, hexadecimal colors, numbers and words to quickly experiment with regular expressions. - 6. Keep your text private
Regex processing happens entirely in your browser using JavaScript's built-in RegExp engine. Your patterns and test data are not sent to a server.
Why use this tool?
Regular expressions can become difficult to understand when a pattern contains multiple groups, flags, lookarounds, character classes, or escape sequences. A live tester makes it much easier to experiment with a pattern and understand exactly what it matches before putting it into your application.