Regex Builder Pack
★Trustedv1.0.0MIT✔Verified88by AgentNode · published 22 days ago · toolpack
Build, test, and explain regular expressions with AI assistance.
Generate regex patterns from natural language, test patterns against sample text, get explanations of complex regex, and convert between regex flavors.
Quick Start
agentnode install regex-builder-packUsage
From packagefrom regex_builder_pack.tool import run
result = run(
action="build_regex",
description="Match US phone numbers in formats like (555) 123-4567, 555-123-4567, or 5551234567",
test_strings=[
"Call me at (555) 123-4567 after 5pm",
"My number is 555-867-5309",
"Phone: 8005551234",
"Not a phone: 12-34"
]
)
print(f"Pattern: {result['pattern']}")
print(f"Flags: {result['flags']}")
print(f"\nExplanation: {result['explanation']}")
for test in result["test_results"]:
status = "MATCH" if test["matched"] else "NO MATCH"
print(f" [{status}] {test['input']}")
if test["matched"]:
print(f" Groups: {test['groups']}")Verification
Package installs and imports correctly. runtime checks passed.
This package was executed and validated by AgentNode before listing. Install, import, and runtime checks passed.
Last verified 18d ago· Runner v2.0.0
Use this when you need to...
- ›Build email validation patterns from natural language descriptions
- ›Generate regex for parsing structured log file entries
- ›Explain complex existing regular expressions in plain English
- ›Test regex patterns against sample strings and show match groups
- ›Convert glob patterns and simple rules into production regex
README
Regex Builder Pack
Build, test, and explain regular expressions with AI assistance. Describe what you want to match in plain English and get a production-ready regex with test validation.
Quick Start
agentnode install regex-builder-pack
from regex_builder_pack.tool import run
result = run(action="build_regex", description="Match email addresses")
print(result["pattern"])
Usage
Build a Regex from Description
result = run(
action="build_regex",
description="Match IPv4 addresses",
test_strings=["192.168.1.1", "10.0.0.255", "999.999.999.999", "hello"]
)
print(f"Pattern: {result['pattern']}")
for t in result["test_results"]:
print(f" {t['input']}: {'match' if t['matched'] else 'no match'}")
Explain an Existing Regex
result = run(
action="explain_regex",
pattern=r"(?P<year>\d{4})-(?P<month>\d{2})-(?P<day>\d{2})"
)
for part in result["breakdown"]:
print(f"{part['fragment']} -> {part['description']}")
Validate and Refine
result = run(
action="refine_regex",
pattern=r"\d{3}-\d{4}",
must_match=["555-1234", "800-0000"],
must_not_match=["55-1234", "abc-defg"]
)
print(f"Refined: {result['pattern']}")
API Reference
| Capability | Description |
|---|---|
build_regex | Generate, test, explain, and refine regular expressions from descriptions |
Requirements
No API keys required. All processing runs locally.
License
MIT
Version History
Capabilities
Permissions
This package declares the following access levels. Review before installing.
agentnode install regex-builder-packFiles (3)
License
MITStats
Compatibility
Frameworks
Runtime
pythonPython Version
>=3.10Trust & Security
Publisher
AgentNode
@agentnode