Regex Tester
Test regex patterns live, inspect groups, and highlight matches in real time.
Pattern & Flags
Input Text
Result
Pattern is valid
Match count: 2
Order IDs: - INV-2026-0001 - INV-2026-0099 - BAD-0000 Contact: [email protected]
Match Groups
Match #1: INV-2026-0001 at index 13
Groups: [1] 2026 | [2] 0001
Match #2: INV-2026-0099 at index 29
Groups: [1] 2026 | [2] 0099
About Regex Tester
This Regex Tester allows you to write, test, and debug regular expressions (regex) for JavaScript in real-time. Regular expressions are powerful tools for pattern matching and text manipulation, but they can be tricky to get right.
Supported Features
- Live Highlighting: See matches update instantly as you type your pattern or test string.
- Regex Flags: Toggle global (
g), case-insensitive (i), and multiline (m) flags. - Capture Groups: Inspect captured groups to verify your sub-patterns are matching correctly.
Common Regex Tokens
| Token | Description | Example |
|---|---|---|
| . | Matches any character except newline | .a matches "ba", "ca" |
| \d | Matches any digit (0-9) | \d+ matches "123" |
| \w | Matches any word character (alphanumeric + underscore) | \w+ matches "hello_1" |
| [abc] | Matches any character in the set | [b-d] matches "b", "c", "d" |
| ^ / $ | Start / End of string (or line with m flag) | ^A matches "A" at start |