Categories

Named Group Tester

Parse and display named capture groups from regex patterns

Named Group Tester

Test and extract named capture groups from regular expressions. This tool helps you work with ES2018 named capture groups syntax (?<name>...) 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 (?<name>...) to define a named capture group
  • Group names must be valid JavaScript identifiers
  • Example: (?<year>\\d{4})-(?<month>\\d{2})-(?<day>\\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

Enable to process each line as a separate test

Show groups with empty/null values in results

Key Facts

Category
Development
Input Types
textarea, text, checkbox, number
Output Type
json
Sample Coverage
4
API Ready
Yes

Overview

The Named Group Tester is a web-based utility for parsing and extracting named capture groups from regular expressions. It supports ES2018 syntax, allowing you to test patterns against input text and view matches with named groups for efficient data extraction and validation.

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 (?<name>...) 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 (?<year>\d{4})-(?<month>\d{2})-(?<day>\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.

Examples

1. Extracting Dates from Text

Data Analyst
Background
You have a dataset with date strings in YYYY-MM-DD format that need to be parsed into components.
Problem
Manually splitting date strings is inefficient and prone to errors.
How to Use
Enter the regex pattern (?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2}) and paste the date strings into the text input.
Example Config
Pattern: (?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2}), Flags: g
Outcome
Each date is parsed into named groups year, month, and day, displayed in a table for easy review or export.

2. Batch Processing Log Entries

System Administrator
Background
Server logs contain unstructured entries with timestamps, severity levels, and messages.
Problem
Extracting structured data from log lines manually is time-consuming and error-prone.
How to Use
Enable batch mode, paste multiple log lines, and use a regex pattern to capture named groups for timestamp, level, and message.
Example Config
Pattern: (?<timestamp>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}) (?<level>\w+) (?<message>.*), Batch Mode: true
Outcome
All log entries are parsed into structured data with named fields, ready for analysis or export to CSV.

Try with Samples

text, regex

Related Hubs

FAQ

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 (?<name>...).

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.

API Documentation

Request Endpoint

POST /en/api/tools/named-group-tester

Request Parameters

Parameter Name Type Required Description
textInput textarea Yes -
pattern text Yes -
flags text No -
batchMode checkbox No Enable to process each line as a separate test
includeUnmatched checkbox No Show groups with empty/null values in results
maxResults number No -

Response Format

{
  "key": {...},
  "metadata": {
    "key": "value"
  },
  "error": "Error message (optional)",
  "message": "Notification message (optional)"
}
JSON Data: JSON Data

AI MCP Documentation

Add this tool to your MCP server configuration:

{
  "mcpServers": {
    "elysiatools-named-group-tester": {
      "name": "named-group-tester",
      "description": "Parse and display named capture groups from regex patterns",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=named-group-tester",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

You can chain multiple tools, e.g.: `https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`, max 20 tools.

If you encounter any issues, please contact us at [email protected]