<< All versions

Skill v1.0.0

Trusted Publisher100/100
microsoft/agent-framework/regex-tester
──Details
PublishedOctober 1, 2026 at 12:38 AM
Content Hashsha256:1cb805d26ba086ee...
Git SHA
──Files
Files (1 file, 1.4 KB)
SKILL.md1.4 KBactive
SKILL.md · 38 lines · 1.4 KB

version: "1.0.0" name: regex-tester description: Validate, test, and debug regular expressions by executing them against sample inputs. Use when asked to build, verify, or explain a regex pattern.


Usage

When the user asks you to create, validate, or debug a regular expression:

  1. Understand the requirement — clarify what the pattern should match and what it should reject.
  2. Consult the cheatsheet — review references/regex-cheatsheet.md for syntax reminders if needed.
  3. Write and execute test code — use the execute_code tool to run Python code that:
  • Compiles the regex with re.compile()
  • Tests it against a set of positive examples (should match) and negative examples (should not match)
  • Extracts and displays any capturing groups
  • Reports pass/fail for each test case
  1. Iterate — if any test fails, refine the pattern and re-run until all cases pass.
  2. Present the result — give the user the final pattern, explain what each part does, and show the test results.

Example Test Script

python
import re
pattern = re.compile(r'^[\w.+-]+@[\w-]+\.[\w.-]+$')
positives = ["user@example.com", "first.last+tag@sub.domain.org"]
negatives = ["@missing.com", "no-at-sign", "spaces in@address.com"]
for s in positives:
assert pattern.match(s), f"FAIL: expected match for '{s}'"
for s in negatives:
assert not pattern.match(s), f"FAIL: expected no match for '{s}'"
print("All tests passed!")
All versionsv1.0.1 →