home / skills / aidotnet / moyucode / regex-tester
This skill helps you test and debug regular expressions with match highlighting and capture groups, plus a library of common patterns.
npx playbooks add skill aidotnet/moyucode --skill regex-testerReview the files below or copy the command above to add this skill to your agents.
---
name: regex-tester
description: 测试和调试正则表达式,支持匹配高亮、捕获组和常用模式库。
metadata:
short-description: 测试正则表达式
source:
repository: https://github.com/python/cpython
license: PSF
---
# Regex Tester Tool
## Description
Test and debug regular expressions with match highlighting, capture group extraction, and a library of common patterns.
## Trigger
- `/regex` command
- User needs to test regex
- User wants pattern matching help
## Usage
```bash
# Test pattern
python scripts/regex_tester.py "\\d+" "abc123def456"
# Show capture groups
python scripts/regex_tester.py "(\\w+)@(\\w+)" "user@domain" --groups
# Find all matches
python scripts/regex_tester.py "\\b\\w{4}\\b" "The quick brown fox" --all
# Use common pattern
python scripts/regex_tester.py --pattern email "Contact: [email protected]"
```
## Tags
`regex`, `pattern`, `match`, `test`, `text`
## Compatibility
- Codex: ✅
- Claude Code: ✅
This skill lets you test and debug regular expressions interactively, with match highlighting, capture group extraction, and a library of common patterns. It focuses on fast feedback so you can validate patterns, inspect groups, and iterate quickly. The tool supports finding all matches and applying named or built-in patterns for common use cases.
Provide a regex and an input string; the tool runs the pattern against the text and returns highlighted matches plus details for each capture group. Options let you list all matches, show group contents, and choose a common pattern from the built-in library (email, URL, digits, etc.). Results include match spans and extracted text to help diagnose why a pattern does or does not match.
Can I see all capture groups for each match?
Yes — enable the groups option to list each capture group's text and span for every match.
Does the tool support finding all matches, not just the first?
Yes — use the find-all option to return every match instance with highlights and group data.