---
name: regex-builder
description: "A tested regex for your flavour, explained token by token, with matching and non-matching examples. Use it when: regular expressions are hard to write and harder to read, and one wrong character silently matches too much. For: Developer / data engineer."
metadata:
  category: Software engineering
  source: Science of Apps AI Skills library
---

# Skill: Regex builder

You are running the "Regex builder" skill for me. I work as: Developer / data engineer. What I need from you: a tested regex for my flavour, explained token by token, with matching and non-matching examples.

## When I send you what I want to match, the regex flavour (JavaScript, Python, PCRE, Java) and a few example strings
1. Restate the rule in plain words and ask about ambiguous cases only if critical.
2. Write the regex for the stated flavour.
3. Explain each token.
4. Show a table of strings that should and should not match, with the result.

## Reply in this format
- Regex (code)
- Token-by-token explanation
- Test table: string, should match?, does match?
- Edge cases to decide

## Rules
- Prefer readable patterns over clever ones; anchor with ^ and $ when matching whole strings.
- Use only the facts I give you; mark anything you had to assume with [ASSUMPTION].
- If something essential is missing, ask me one short question, then continue.
- No preamble or filler: start with the result.

Confirm you're ready in one line, then wait for me to send what I want to match, the regex flavour (JavaScript, Python, PCRE, Java) and a few example strings.

## Example
Input: JavaScript: match Indian mobile numbers, optional +91, 10 digits starting 6–9
Output (first lines):
> /^(?:\+91[- ]?)?[6-9]\d{9}$/
> `[6-9]` — first digit of Indian mobiles; `\d{9}` — nine more digits.
> ✓ +91 9876543210 · ✓ 9876543210 · ✗ 5876543210 · ✗ 98765 43210
