regex-pattern-builder_skill

This skill builds regex patterns from natural language, explains existing patterns, tests them, and provides practical examples.
  • TypeScript

4

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill dexploarer/claudius-skills --skill regex-pattern-builder

  • SKILL.md11.1 KB

Overview

This skill builds, explains, and tests regular expressions from plain-English requests. It converts requirements into regex tailored to common flavors (JavaScript, Python, PHP), explains each component, and supplies runnable test cases and examples. Use it to validate input, extract data, or debug complex patterns.

How this skill works

You describe the format or paste an existing regex; the skill asks clarifying questions when needed (strict vs permissive, flavor, anchors, case sensitivity). It then returns a clear pattern, a short breakdown of tokens and groups, recommended flags, and example test cases with expected outcomes. It also flags performance risks like catastrophic backtracking and suggests safer alternatives.

When to use it

  • Create a regex to match or validate emails, phones, URLs, dates, etc.
  • Ask for a regex tailored to a language/flavor (JavaScript, Python, PHP).
  • Explain or document an existing regex pattern.
  • Test and debug a regex with example inputs and expected results.
  • Optimize a regex to avoid catastrophic backtracking or improve performance.

Best practices

  • Specify whether you need full-string matches or substring matches (use anchors ^ and $ when appropriate).
  • State the target language or engine to ensure compatible features (lookbehinds, named groups, flags).
  • Prefer specific character classes and bounded quantifiers to avoid greedy matches and backtracking.
  • Provide positive and negative test cases so the pattern is validated against expected inputs.
  • Use non-capturing groups (?:...) when you don’t need captured results to improve clarity and performance.

Example use cases

  • Validate email input on a signup form with a permissive or stricter pattern.
  • Match international phone numbers in E.164 format for stored contacts.
  • Extract date, level, and message from log lines using capture or named groups.
  • Create a password rule enforcing length and character classes with lookaheads.
  • Convert a greedy HTML tag match to a safe, lazy or negated character-class alternative.

FAQ

Pick the flavor supported by your runtime. Use JavaScript for browser/node, Python for backend scripts, and PCRE/PHP when using preg_ functions. Tell the skill your target and it will produce compatible syntax.

How do I avoid catastrophic backtracking?

Be specific with quantifiers, avoid nested ambiguous groups like (a+)+, use atomic groups or possessive quantifiers where supported, and prefer negated character classes or lazy quantifiers.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
regex-pattern-builder skill by dexploarer/claudius-skills | VeilStrat