@gongrzhe/server-regex-playground
v1.0.0
Published
Regex Playground MCP App Server with interactive regex tester, match highlighting, and capture group visualization
Readme
Regex Playground MCP Server
Interactive regex tester with match highlighting, capture group visualization, and pattern explanation.
Features
- Real-time Regex Testing - Test patterns against strings with instant feedback
- Match Highlighting - See all matches with their exact positions and indices
- Capture Group Visualization - View named and numbered capture groups separately
- Pattern Explanation - Break down regex patterns into individual tokens with descriptions
- Flag Support - Test with various flags (global, case-insensitive, multiline, dotAll, unicode)
- Error Handling - Clear error messages for invalid regex patterns
Installation
npm install @gongrzhe/server-regex-playgroundUsage
As a CLI
npx @gongrzhe/server-regex-playgroundClaude Desktop Configuration
{
"mcpServers": {
"regex-playground": {
"command": "npx",
"args": ["-y", "@gongrzhe/server-regex-playground"]
}
}
}Claude Code Configuration
claude mcp add regex-playground -- npx -y @gongrzhe/server-regex-playgroundTools
test-regex
Tests a regular expression against a string and returns all matches with indices and capture groups.
Inputs:
pattern(string): The regex pattern to testtestString(string): The string to test the regex againstflags(string, optional): Regex flags (g, i, m, s, u)
Output:
matches(array): Array of match objects with fullMatch, index, length, and capture groupsmatchCount(number): Total number of matches foundisValid(boolean): Whether the pattern is validerror(string, optional): Error message if pattern is invalid
explain-regex
Breaks down a regular expression into tokens and explains each part.
Inputs:
pattern(string): The regex pattern to explainflags(string, optional): Regex flags (g, i, m, s, u)
Output:
tokens(array): Array of token objects with token, description, and positionsummary(string): High-level summary of the pattern and flagsisValid(boolean): Whether the pattern is validerror(string, optional): Error message if pattern is invalid
Example Prompt
Test the regex (\d{4})-(\d{2})-(\d{2}) against "Today is 2026-02-14 and tomorrow is 2026-02-15"Then explain what each part of the pattern means.
License
MIT
