Regex Tester
Test and debug JavaScript-compatible regular expressions in real-time with syntax highlighting and group capture tables.
Regex
Load Preset Pattern
//g
Regex Flags
Test String
Match Visualization2 matches
You can reach support at support@company.com or contact our sales team at sales-info@company.co.uk. Note that invalid.email@com is not matches because of short extension rules.
Matches Detail List (2)
| # | Index | Matched Text | Capture Groups | Copy |
|---|---|---|---|---|
| 1 | 25 | support@company.com | none | |
| 2 | 74 | sales-info@company.co.uk | none |
What is a Regular Expression?
A Regular Expression (commonly abbreviated as regex or regexp) is a sequence of characters that forms a search pattern. These patterns can be used for string-matching, string-replacement, and input validation operations.
In JavaScript, regular expressions are represented by the RegExp object, which supports several key flags:
g(Global): Find all matches rather than stopping after the first match.i(Case-insensitive): Ignore case differences when matching.m(Multiline): Treat beginning (^) and end ($) characters as working across multiple lines.s(dotAll): Allows the dot (.) character to match newline characters.u(Unicode): Enable full Unicode support in character sets.
How to use the Regex Tester
- Regex Pattern: Enter your regex pattern in the pattern input box (exclude the wrapping slashes
/.../). - Flags: Toggle standard flags (
g,i,m,s) using the checkboxes. - Test String: Type or paste your sample text into the test area.
- View Matches: The tool will highlight matches directly within the text area and present a list of matched strings along with their indexes and any capturing groups.
- Load Presets: Select from common presets (e.g., email, phone number, date) to quickly load patterns.