# Named Group Tester

Parse and display named capture groups from regex patterns

> Canonical page: https://elysiatools.com/en/tools/named-group-tester

- **Category:** Development

- **Keywords:** regex, named groups, capture groups, tester, pattern, ES2018, 正则命名分组, 正则测试

## Overview

\## Named Group Tester Test and extract named capture groups from regular expressions. This tool helps you work with ES2018 named capture groups syntax \`(?...)\` in your regex patterns. \*\*Features:\*\* - Parse and display all named capture groups from your regex pattern - Test against input text and extract all matches with their named groups - View results in an organized table format - Support for batch processing (one test string per line) - Export results to JSON/CSV format - Comprehensive statistics about matches and groups \*\*Named Group Syntax:\*\* - Use \`(?...)\` to define a named capture group - Group names must be valid JavaScript identifiers - Example: \`(?\\\\d{4})-(?\\\\d{2})-(?\\\\d{2})\` \*\*Instructions:\*\* 1. Enter your regex pattern with named groups 2. Optionally set regex flags (default: "g" for global matching) 3. Enter text to test against 4. Toggle batch mode to test multiple strings (one per line) 5. Adjust max results limit if needed 6. Click to see all matches with their named group values \*\*Use Cases:\*\* - Parsing and validating structured data (dates, URLs, coordinates) - Extracting specific fields from log files - Testing complex regex patterns before production use - Learning and debugging named capture groups

## Inputs

- **Text Input** (textarea): Enter text to test against (one test string per line in batch mode)...
- **Regex Pattern** (text): Enter pattern with named groups, e.g., (?\\d{4})-(?\\d{2})
- **Regex Flags** (text): g, i, m, etc.
- **Batch Mode** (checkbox): Enable to process each line as a separate test
- **Include Unmatched Groups** (checkbox): Show groups with empty/null values in results
- **Max Results** (number): Maximum matches to return

## When to use

- When extracting specific fields from structured text like dates, URLs, or coordinates.
- When parsing log files or text data to capture named segments for analysis.
- When developing or debugging regex patterns that use named capture groups.

## How it works

- Enter your regex pattern with named groups using the (?...) syntax.
- Input the text to test, with an option for batch mode to process multiple lines.
- Configure regex flags and set a maximum results limit as needed.
- View extracted matches and named groups in a table or export to JSON/CSV.

## Use cases

- Extracting and validating dates from text using patterns like (?\\d{4})-(?\\d{2})-(?\\d{2}).
- Parsing server logs to capture timestamps, log levels, and messages with named groups.
- Testing complex regex patterns with named groups before deploying them in production code.

## Frequently asked questions

### What is a named capture group in regex?

A named capture group is a part of a regex pattern that captures matched text and assigns it a name, using the syntax (?...).

### How do I test a regex pattern with this tool?

Enter your pattern with named groups, input the text, and click to see all matches with their named group values displayed.

### Can I process multiple test strings at once?

Yes, enable batch mode to test each line of input as a separate string for batch processing.

### What output formats are available?

Results can be viewed in an organized table or exported to JSON or CSV format for further use.

### Is there a limit on the number of matches?

You can set a maximum results limit, defaulting to 100, to control the output size and performance.

## Related tools

- [AI Regex Explainer](https://elysiatools.com/en/tools/ai-regex-explainer): Use AI to break down regular expressions into readable explanations
- [Bulk Email Extractor](https://elysiatools.com/en/tools/bulk-email-extractor): Extract all email addresses from input text, articles, web source code, or mixed content. Supports deduplication and export to JSON.
- [Glob to Regex](https://elysiatools.com/en/tools/glob-to-regex): Convert file matching patterns (Glob) to regular expressions
- [Regex to String Generator](https://elysiatools.com/en/tools/regex-to-string-generator): Generate random strings that match a given regular expression pattern
- [Changelog Extractor](https://elysiatools.com/en/tools/changelog-extractor): Parse and extract structured data from changelogs and release notes in multiple formats
- [Docstring Extractor](https://elysiatools.com/en/tools/docstring-extractor): Extract and parse documentation from JavaScript/TypeScript, Python, and Java source code
- [C# Regex Tester (.NET)](https://elysiatools.com/en/tools/csharp-regex-tester): Test .NET/C# regular expressions online with named groups ((?…)), IgnoreCase/Multiline/Singleline options, match highlighting, capture-group tables, a ready-to-paste C# snippet and an IgnorePatternWhitespace preview.
- [Java Regex Tester](https://elysiatools.com/en/tools/java-regex-tester): Test java.util.regex patterns online: (?…) named groups, possessive quantifiers and atomic groups, Pattern flags, ASCII vs UNICODE\_CHARACTER\_CLASS \\d semantics, and ready-to-paste Java code.

## Samples

- [Regex Named Capture Groups](https://elysiatools.com/en/samples/regex-named-groups): Collection of regex patterns using named capture groups for extracting structured data from text. Named groups make patterns more readable and maintainable by assigning meaningful names to captured portions.
- [Regex Replace Samples](https://elysiatools.com/en/samples/regex-replace): Collection of common and useful regex replacement patterns for text transformation and data cleaning
- [Regex Pattern Alternatives](https://elysiatools.com/en/samples/regex-alternatives): Multiple ways to write the same regex pattern with different trade-offs in readability, performance, and accuracy
- [Common Regex Patterns](https://elysiatools.com/en/samples/regex-samples): Commonly used regular expression patterns for validation and matching

## Related content

- [Regex Testing, Visualization, and Safety Workflow](https://elysiatools.com/en/hubs/regex-utility): Build reliable regular expressions by learning syntax, testing matches, visualizing structure, previewing replacements, benchmarking alternatives, and scanning for ReDoS risk.
- [Observability Debugging from Logs, Traces, Webhooks, and JSON Payloads](https://elysiatools.com/en/hubs/observability-debugging): Parse logs, decode traces, inspect webhook/API evidence, explore JSON payloads, and extract recurring patterns before writing an incident-ready debugging note.
