Regex Builder Pack

Trustedv1.0.0MITVerified88

by 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.

langchaincrewaigeneric

Quick Start

bash
agentnode install regex-builder-pack

Usage

From package
python
from 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

high confidence88/100✔ Verified
smokeReturned valid result
+25/25
testsAuto-generated tests only
+8/15
importAll tools imported successfully
+15/15
installInstalled in 1.9s
+15/15
contractAll contract checks passed
+10/10
warningsNo warnings
0/0
determinismOutput consistency check
+5/5
reliability3/3 runs passed
+10/10

Package installs and imports correctly. runtime checks passed.

install1.9s
import89ms
smoke126ms
tests1.2s

This package was executed and validated by AgentNode before listing. Install, import, and runtime checks passed.

Python 3.12.3ffmpegpopplertesseractuv

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

CapabilityDescription
build_regexGenerate, test, explain, and refine regular expressions from descriptions

Requirements

No API keys required. All processing runs locally.

License

MIT

Version History

Capabilities

regex_buildingbuild_regextool

Permissions

This package declares the following access levels. Review before installing.

Networknone
Filesystemnone
Code Executionnone
Data Accessinput_only
User Approvalnever
bash
agentnode install regex-builder-pack

Files (3)

License

MIT

Stats

Downloads0
Installs0
Versionv1.0.0
Published3/16/2026
Channelstable
Typetoolpack
Entrypointregex_builder_pack.tool

Compatibility

Frameworks

langchaincrewaigeneric

Runtime

python

Python Version

>=3.10

Trust & Security

PublisherTrusted
SignatureNone
ProvenanceNone
Security Issues0

Publisher

A

AgentNode

@agentnode