Related Tools
What is Regex Tester?
A Regex Tester is a tool that allows you to test regular expressions (regex) against a target string, highlighting matches and providing details about captured groups.
Key Features
**Real-time Highlighting:** See matches instantly as you type.
**Match Details:** View index and captured groups for each match.
**Cheatsheet:** Quick reference for common regex patterns.
**Code Generator:** Generate regex code for 15+ programming languages.
Shareable LinksShare regex patterns and test strings via link. (Limit: 5KB)
How to Use
1
Enter your regular expression pattern.
2
Select flags (Global, Multiline, Case Insensitive, etc.).
3
Type or paste your test string.
4
View highlighted matches and details.
Examples
Input
=== CHARACTER CLASSES ===
Pattern: \d+ Text: "Order #12345" → Matches: 12345
Pattern: \w+ Text: "hello_world" → Matches: hello_world
Pattern: \s Text: "a b" → Matches: (space)
Pattern: . Text: "abc" → Matches: a, b, c
=== ANCHORS ===
Pattern: ^Hello Text: "Hello World" → Matches: Hello (at start)
Pattern: World$ Text: "Hello World" → Matches: World (at end)
Pattern: \bword\b Text: "a word here" → Matches: word (whole word)
=== QUANTIFIERS ===
Pattern: a+ Text: "caaandy" → Matches: aaa
Pattern: a* Text: "cdy" → Matches: (empty)
Pattern: a? Text: "candy" → Matches: a
Pattern: a{2,4} Text: "caaaandy" → Matches: aaaa
=== GROUPS & LOOKAROUND ===
Pattern: (ab)+ Text: "ababab" → Matches: ababab
Pattern: (?=USD) Text: "100 USD" → Matches: position before USD
Pattern: (?<=\$)\d+ Text: "$100" → Matches: 100
=== VALIDATION PATTERNS ===
Email: [\w.-]+@[\w.-]+\.[a-z]{2,}
IPv4: (?:\d{1,3}\.){3}\d{1,3}
Date: \d{4}-\d{2}-\d{2}
Hex: #[0-9a-fA-F]{3,6}Output
=== SAMPLE MATCHES ===
Email Pattern on: "Contact: [email protected], [email protected]"
Match 1: [email protected]
Match 2: [email protected]
\d+ Pattern on: "Price: $49.99, Qty: 3"
Match 1: 49
Match 2: 99
Match 3: 3
\b\w{4}\b Pattern on: "The quick brown fox"
Match 1: quick (skips "The" - 3 chars, "brown" - 5 chars)
No match: "fox" (3 chars)
^Start on: "Start here\nStart again" (multiline)
Match 1: Start (line 1)
Match 2: Start (line 2)Frequently Asked Questions
Which regex flavor is supported?
This tool uses JavaScript's built-in RegExp engine.
