regex_builder

Create, test, and debug regular expressions with syntax references and security checks.

Updated Jan 14, 2026
One-click install
npx skills add https://github.com/jvsandhu/agentic-skills --skill regex-builder-jvsandhu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: regex_builder
Source: https://github.com/jvsandhu/agentic-skills/tree/main/skills/regex_builder
Command: npx skills add https://github.com/jvsandhu/agentic-skills --skill regex-builder-jvsandhu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing correct regular expressions is error-prone: patterns often fail on edge cases, suffer from catastrophic backtracking (ReDoS), or silently accept invalid input. This Skill provides a structured reference and workflow for building, testing, and hardening regex patterns. ## Core Features & Use Cases - Syntax Reference: Quick tables for character classes, quantifiers, anchors, groups, and lookarounds. - Ready-Made Patterns: Common patterns for email, URL, phone, IP address, date, and strong password validation. - Testing & Debugging Workflow: Guidance for visual testing on Regex101, unit testing positive and negative cases, and preventing ReDoS with atomic groups and possessive quantifiers. - Use Case: When you need to validate user input such as Turkish phone numbers or dates in a JavaScript or Python application, use this Skill to get a correct pattern, test it, and ensure it is safe against denial-of-service attacks. ## Quick Start Ask the agent to build and test a regular expression for validating email addresses in JavaScript, including negative test cases and a ReDoS safety check.

Frequently Asked Questions about regex_builder

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a regex to validate an email address?

Use the pattern ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2}$ to match standard email formats. Anchor it with ^ and $ so the entire string must conform, and test both valid and invalid addresses before deploying.

How to test regular expressions in JavaScript and Python?

In JavaScript, use regex.test('string') for boolean checks and 'string'.match(regex) for matches. In Python, use re.search() to find matches, re.findall() for all occurrences, and re.sub() for replacements.

What is ReDoS and how do I prevent catastrophic backtracking?

ReDoS (Regular expression Denial of Service) occurs when nested quantifiers cause exponential backtracking on crafted input. Prevent it by using atomic groups (?>...), possessive quantifiers like ++, and scanning patterns with safe-regex tools.

What is the difference between greedy and lazy quantifiers in regex?

Greedy quantifiers like .* match as much text as possible, while lazy quantifiers like .*? match as little as possible. Use lazy matching when extracting content between delimiters to avoid over-capturing across multiple segments.

Does regex support Unicode characters and emojis?

Yes, enable Unicode support with the u flag in JavaScript or default Unicode handling in Python 3. This ensures correct matching of UTF-8 characters, emojis, and international text that basic ASCII patterns would miss.

When should I use a library instead of writing a custom regex?

Prefer dedicated libraries like URL parsers or email validators for very complex patterns instead of reinventing the wheel. Custom regex is appropriate for simpler, well-defined formats such as dates, phone numbers, or IDs.