Cleanup Review
python scripts/_purge_cache.py is an optional cleanup helper for the Regexr skill. It may recursively remove /tmp/skill_cache. Show the exact paths first, explain whether they are skill-private temporary paths or user state, and run the cleanup only after the user confirms.
Regexr
Developer tools CLI for checking, validating, generating, and working with regular expressions and code patterns. Lint syntax, explain complex expressions, convert between formats, generate templates, diff pattern versions, preview matches, fix common regex issues, and produce reports — all from the command line with persistent local logging.
Commands
Run regexr <command> [args] to use.
| Command |
Description |
check |
Check regex patterns for correctness and common pitfalls |
validate |
Validate regex syntax and structure |
generate |
Generate regex patterns from descriptions or examples |
format |
Format and prettify regex expressions |
lint |
Lint regex for style, performance, and safety issues |
explain |
Explain what a regex pattern does in plain language |
convert |
Convert regex between flavors (PCRE, JS, Python, etc.) |
template |
Apply or manage regex templates for common use cases |
diff |
Diff two regex patterns and show behavioral differences |
preview |
Preview regex matches against sample text |
fix |
Auto-fix common regex issues (escaping, anchoring, etc.) |
report |
Generate regex quality and coverage reports |
stats |
Show summary statistics across all categories |
export <fmt> |
Export data in json, csv, or txt format |
search <term> |
Search across all logged entries |
recent |
Show recent activity from history log |
status |
Health check — version, data dir, disk usage |
help |
Show help and available commands |
version |
Show version (v2.0.0) |
Each domain command (check, validate, generate, etc.) works in two modes:
- Without arguments: displays the most recent 20 entries from that category
- With arguments: logs the input with a timestamp and saves to the category log file
Data Storage
All data is stored locally in ~/.local/share/regexr/:
- Each command creates its own log file (e.g.,
check.log, validate.log, generate.log)
- A unified
history.log tracks all activity across commands
- Entries are stored in
timestamp|value pipe-delimited format
- Export supports JSON, CSV, and plain text formats
Requirements
- Bash 4+ with
set -euo pipefail strict mode
- Standard Unix utilities:
date, wc, du, tail, grep, sed, cat
- No external dependencies or API keys required
When to Use
- Building and testing regex patterns — use
generate to create patterns from descriptions, check to verify correctness, and preview to test against sample data
- Learning and understanding regex — use
explain to break down complex patterns into plain-language descriptions, perfect for code reviews or onboarding
- Linting and fixing regex in codebases — run
lint to catch performance and safety issues (catastrophic backtracking, unanchored patterns), then fix to auto-correct them
- Converting regex across languages — use
convert to translate patterns between JavaScript, Python, PCRE, and other flavors when porting code
- Documenting regex usage in projects — log patterns with
template, generate report summaries, and export data for documentation or audits
Examples
# Check a regex pattern for issues
regexr check "^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z]{2,}$ — email validation"
# Validate regex syntax
regexr validate "(?<=@)[a-z]+\.com — lookbehind syntax OK"
# Generate a pattern from description
regexr generate "match IPv4 addresses: \d{1,3}(\.\d{1,3}){3}"
# Explain a complex regex
regexr explain "^(?=.*[A-Z])(?=.*\d).{8,}$ — password: 1 uppercase, 1 digit, 8+ chars"
# Lint for performance issues
regexr lint "(a+)+ — warning: catastrophic backtracking possible"
# Convert between flavors
regexr convert "JS→Python: /\d+/g becomes re.findall(r'\d+', text)"
# Fix common issues
regexr fix "added anchors: ^pattern$ and escaped special chars"
# Preview matches
regexr preview "pattern=[0-9]{3}-[0-9]{4} matched: 555-1234, 800-9999"
# View summary statistics
regexr stats
# Export all data as JSON
regexr export json
# Search logged patterns
regexr search "email"
Output
All commands output to stdout. Redirect to a file if needed:
regexr report "weekly pattern audit" > report.txt
regexr export csv # saves to ~/.local/share/regexr/export.csv
Configuration
Set DATA_DIR by modifying the script, or use the default: ~/.local/share/regexr/
Powered by BytesAgain | bytesagain.com | hello@bytesagain.com
1---2name: regexr-23description: "Create, test, and learn regular expressions with live matching. Use when validating patterns, checking groups, generating regex, linting syntax."4version: "2.0.0"5author: "BytesAgain"6homepage: https://bytesagain.com7source: https://github.com/bytesagain/ai-skills8tags: ["regex", "regexp", "正则表达式", "pattern", "javascript", "utility", "developer"]9categories: ["Developer Tools", "Utility"]10commands:11 - name: "help"12 description: "显示RegExr工具的帮助信息和可用命令列表。"13 usage: "regexr help"14 - name: "run"15 description: "启动RegExr交互式界面,允许用户创建、测试和调试正则表达式。"16 usage: "regexr run"17 - name: "info"18 description: "提供RegExr工具的版本信息和相关资源链接。"19 usage: "regexr info"20 - name: "status"21 description: "检查RegExr工具的运行状态和依赖项健康状况。"22 usage: "regexr status"23changelog:24 - version: "2.0.0"25 date: "2026-03-15"26 changes:27 - "初始版本发布"28pricing_model: "free"29license: "MIT"30docs_url: "https://bytesagain.com/skills/regexr"31support_url: "https://bytesagain.com/feedback"32metadata:33 source: https://skillmd.com/skills/knownasnaffy/regexr-234---3536373839### Cleanup Review4041`python scripts/_purge_cache.py` is an optional cleanup helper for the `Regexr` skill. It may recursively remove /tmp/skill_cache. Show the exact paths first, explain whether they are skill-private temporary paths or user state, and run the cleanup only after the user confirms.4243# Regexr4445Developer tools CLI for checking, validating, generating, and working with regular expressions and code patterns. Lint syntax, explain complex expressions, convert between formats, generate templates, diff pattern versions, preview matches, fix common regex issues, and produce reports — all from the command line with persistent local logging.4647## Commands4849Run `regexr <command> [args]` to use.5051| Command | Description |52|---------|-------------|53| `check` | Check regex patterns for correctness and common pitfalls |54| `validate` | Validate regex syntax and structure |55| `generate` | Generate regex patterns from descriptions or examples |56| `format` | Format and prettify regex expressions |57| `lint` | Lint regex for style, performance, and safety issues |58| `explain` | Explain what a regex pattern does in plain language |59| `convert` | Convert regex between flavors (PCRE, JS, Python, etc.) |60| `template` | Apply or manage regex templates for common use cases |61| `diff` | Diff two regex patterns and show behavioral differences |62| `preview` | Preview regex matches against sample text |63| `fix` | Auto-fix common regex issues (escaping, anchoring, etc.) |64| `report` | Generate regex quality and coverage reports |65| `stats` | Show summary statistics across all categories |66| `export <fmt>` | Export data in json, csv, or txt format |67| `search <term>` | Search across all logged entries |68| `recent` | Show recent activity from history log |69| `status` | Health check — version, data dir, disk usage |70| `help` | Show help and available commands |71| `version` | Show version (v2.0.0) |7273Each domain command (check, validate, generate, etc.) works in two modes:74- **Without arguments**: displays the most recent 20 entries from that category75- **With arguments**: logs the input with a timestamp and saves to the category log file7677## Data Storage7879All data is stored locally in `~/.local/share/regexr/`:8081- Each command creates its own log file (e.g., `check.log`, `validate.log`, `generate.log`)82- A unified `history.log` tracks all activity across commands83- Entries are stored in `timestamp|value` pipe-delimited format84- Export supports JSON, CSV, and plain text formats8586## Requirements8788- Bash 4+ with `set -euo pipefail` strict mode89- Standard Unix utilities: `date`, `wc`, `du`, `tail`, `grep`, `sed`, `cat`90- No external dependencies or API keys required9192## When to Use93941. **Building and testing regex patterns** — use `generate` to create patterns from descriptions, `check` to verify correctness, and `preview` to test against sample data952. **Learning and understanding regex** — use `explain` to break down complex patterns into plain-language descriptions, perfect for code reviews or onboarding963. **Linting and fixing regex in codebases** — run `lint` to catch performance and safety issues (catastrophic backtracking, unanchored patterns), then `fix` to auto-correct them974. **Converting regex across languages** — use `convert` to translate patterns between JavaScript, Python, PCRE, and other flavors when porting code985. **Documenting regex usage in projects** — log patterns with `template`, generate `report` summaries, and `export` data for documentation or audits99100## Examples101102```bash103# Check a regex pattern for issues104regexr check "^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z]{2,}$ — email validation"105106# Validate regex syntax107regexr validate "(?<=@)[a-z]+\.com — lookbehind syntax OK"108109# Generate a pattern from description110regexr generate "match IPv4 addresses: \d{1,3}(\.\d{1,3}){3}"111112# Explain a complex regex113regexr explain "^(?=.*[A-Z])(?=.*\d).{8,}$ — password: 1 uppercase, 1 digit, 8+ chars"114115# Lint for performance issues116regexr lint "(a+)+ — warning: catastrophic backtracking possible"117118# Convert between flavors119regexr convert "JS→Python: /\d+/g becomes re.findall(r'\d+', text)"120121# Fix common issues122regexr fix "added anchors: ^pattern$ and escaped special chars"123124# Preview matches125regexr preview "pattern=[0-9]{3}-[0-9]{4} matched: 555-1234, 800-9999"126127# View summary statistics128regexr stats129130# Export all data as JSON131regexr export json132133# Search logged patterns134regexr search "email"135```136137## Output138139All commands output to stdout. Redirect to a file if needed:140141```bash142regexr report "weekly pattern audit" > report.txt143regexr export csv # saves to ~/.local/share/regexr/export.csv144```145146## Configuration147148Set `DATA_DIR` by modifying the script, or use the default: `~/.local/share/regexr/`149150---151Powered by BytesAgain | bytesagain.com | hello@bytesagain.com