AI
Pass

AI Regex Generator — Agent Skill

AI Regex Generator — Agent Skill

Generate regex patterns from plain English descriptions via the AI Pass API.

Setup

  1. Create account at aipass.one
  2. Developer Dashboard → API Keys
  3. Set $AIPASS_API_KEY

Related

Skill File

---
name: ai-regex-generator
description: Generate regex patterns from plain English using AI Pass API.
version: 1.0.0
---

# AI Regex Generator Skill

## Auth
- **API Key:** `$AIPASS_API_KEY`
- Get your key: https://aipass.one/panel/developer.html → API Keys

## Generate Regex

```bash
curl -s -X POST https://aipass.one/apikey/v1/chat/completions \
  -H "Authorization: Bearer $AIPASS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5-mini",
    "messages": [
      {"role": "system", "content": "Generate a regex pattern with explanation and test examples. Include: 1) Pattern 2) Breakdown 3) Match examples 4) Non-match examples"},
      {"role": "user", "content": "Match email addresses ending in .edu"}
    ]
  }'
```

**Response:** `response.choices[0].message.content`

## Python

```python
import requests, os

def generate_regex(description, language="Python"):
    r = requests.post(
        "https://aipass.one/apikey/v1/chat/completions",
        headers={
            "Authorization": f"Bearer {os.environ['AIPASS_API_KEY']}",
            "Content-Type": "application/json"
        },
        json={
            "model": "gpt-5-mini",
            "messages": [
                {"role": "system", "content": f"Generate a regex for {language} with explanation and test examples."},
                {"role": "user", "content": description}
            ]
        }
    )
    return r.json()["choices"][0]["message"]["content"]
```

## Cost
- ~$0.001 per generation
- $1 free credit on signup
Download Skill File