Regex Tester
Test regular expressions with real-time highlighting, flag toggles, and group capture breakdown.
Capture groups
/(\w+)@([\w.]+)/gCommon Problems
How to test a regex pattern online?
Some patterns cause catastrophic backtracking (e.g., (a+)+). The tester catches RegExp errors but cannot prevent all infinite loops — if it hangs, refresh the page.
How to extract email addresses with regex?
Learning and experimenting with JavaScript regex syntax. Some patterns cause catastrophic backtracking (e.g., (a+)+). The tester catches RegExp errors but cannot prevent all infinite loops — if it hangs, refresh the page. The standard JavaScript RegExp engine — patterns behave identically to what you'd use in.
How to use capture groups in JavaScript?
How do I use named capture groups? The Groups panel shows each capture group's value. Enter a pattern, toggle flags, type your test string — matches highlight instantly and capture groups are broken down by index and name. Everything runs locally in the browser, which keeps the workflow fast and privacy-friendly.
How to match multiple lines with regex?
Enter a pattern, toggle flags, type your test string — matches highlight instantly and capture groups are broken down by index and name.
What does the g flag do in regex?
The standard JavaScript RegExp engine — patterns behave identically to what you'd use in Node.js, Chrome DevTools, or any JS runtime.
How to use named capture groups?
Use (?<name>pattern) syntax. Named groups appear in the Groups panel with their names alongside index-based groups.
How to count regex matches?
Regex Tester provides a real-time environment to write and debug JavaScript regular expressions.
Workflow
What is Regex Tester?
Regex Tester provides a real-time environment to write and debug JavaScript regular expressions. Enter a pattern, toggle flags, type your test string — matches highlight instantly and capture groups are broken down by index and name.
How to use Regex Tester
Enter your pattern in the regex field. Toggle flags (g, i, m, s, u) using the buttons. Type or paste your test string. The Groups panel shows each capture group's value. Match count updates as you type.
Example
Pattern: (\w+)@([\w.]+)
Flags: gi
Test: Contact: hello@aistacker.dev or support@example.com
Matches: 2
Group 1: hello, support
Group 2: aistacker.dev, example.comUse Cases
1. Validating email, phone, and URL formats before writing code.
2. Extracting structured data from server logs and API responses.
3. Building find-and-replace patterns for code editors.
4. Learning and experimenting with JavaScript regex syntax.
5. Debugging regex that works in one language but not another.
FAQ
Which regex engine is used?
The standard JavaScript RegExp engine — patterns behave identically to what you'd use in Node.js, Chrome DevTools, or any JS runtime.
Why is my pattern causing the page to hang?
Some patterns cause catastrophic backtracking (e.g., (a+)+). The tester catches RegExp errors but cannot prevent all infinite loops — if it hangs, refresh the page.
How do I use named capture groups?
Use (?<name>pattern) syntax. Named groups appear in the Groups panel with their names alongside index-based groups.