AIStacker
Text

Overview

Regex Tester

Test regular expressions with real-time highlighting, flag toggles, and group capture breakdown.

Category hub

Text

Problems

7

FAQ

3

//
2 matches
Matches highlighted
Contact us at hello@aistacker.dev or support@example.com

Capture groups

Match 1: hello@aistacker.dev$1: hello$2: aistacker.dev
Match 2: support@example.com$1: support$2: example.com
/(\w+)@([\w.]+)/g

What you can solve

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.

Typical workflow

Regex TesterURL Decoder

Guides for this workflow

Supporting guides that connect this tool to the broader category workflow.

Open category hub

What is

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

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

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.com

Common use cases

Common use 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.

Frequently asked questions

Frequently asked questions

Which regex engine is used?v
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?v
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?v
Use (?<name>pattern) syntax. Named groups appear in the Groups panel with their names alongside index-based groups.