🎯

regex-helper

🎯Skill

from ntaksh42/agents

VibeIndex|
What it does

Generates, explains, and tests regular expressions with comprehensive examples and validation across multiple programming languages.

📦

Part of

ntaksh42/agents(78 items)

regex-helper

Installation

📋 No install commands found in docs. Showing default command. Check GitHub for actual instructions.
Quick InstallInstall with npx
npx skills add ntaksh42/agents --skill regex-helper
2Installs
-
AddedFeb 4, 2026

Skill Details

SKILL.md

Generate, explain, and test regular expressions with examples and test cases. Use when creating regex patterns or understanding complex regular expressions.

Overview

# Regex Helper Skill

正規表現パターンを生成・説明・テストするスキルです。

概要

複雑な正規表現を簡単に作成し、既存のパターンを理解しやすく説明します。

主な機能

  • パターン生成: 要件から正規表現を自動生成
  • パターン説明: 既存の正規表現を人間が読める形で説明
  • テストケース: マッチする例、しない例を提供
  • 最適化: より効率的なパターンへの変換
  • デバッグ: 動作しないパターンの修正
  • 言語対応: JavaScript、Python、Java、Go等

使用方法

パターン生成

```

以下の要件で正規表現を生成:

  • メールアドレスの検証
  • RFC 5322準拠
  • サブドメイン対応

```

パターン説明

```

以下の正規表現を説明:

^(?=.[A-Z])(?=.[a-z])(?=.\d)(?=.[@$!%?&])[A-Za-z\d@$!%?&]{8,}$

```

生成例

メールアドレス

要件: 基本的なメールアドレス検証

生成パターン:

```javascript

/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/

```

説明:

  • ^ - 文字列の開始
  • [a-zA-Z0-9._%+-]+ - ユーザー名部分(英数字と一部記号)
  • @ - アットマーク(必須)
  • [a-zA-Z0-9.-]+ - ドメイン名
  • \. - ドット(エスケープ)
  • [a-zA-Z]{2,} - トップレベルドメイン(2文字以上)
  • $ - 文字列の終了

テストケース:

```

✅ マッチする:

  • user@example.com
  • john.doe@company.co.jp
  • test+tag@domain.com

❌ マッチしない:

  • invalid.email
  • @example.com
  • user@
  • user@domain

```

パスワード強度

要件:

  • 8文字以上
  • 大文字1文字以上
  • 小文字1文字以上
  • 数字1文字以上
  • 特殊文字1文字以上

生成パターン:

```javascript

/^(?=.[A-Z])(?=.[a-z])(?=.\d)(?=.[@$!%?&])[A-Za-z\d@$!%?&]{8,}$/

```

説明:

  • (?=.*[A-Z]) - 先読み: 大文字が1つ以上存在
  • (?=.*[a-z]) - 先読み: 小文字が1つ以上存在
  • (?=.*\d) - 先読み: 数字が1つ以上存在
  • (?=.[@$!%?&]) - 先読み: 特殊文字が1つ以上存在
  • [A-Za-z\d@$!%*?&]{8,} - 許可文字で8文字以上

テストケース:

```

✅ マッチする:

  • Password123!
  • Secure@Pass1
  • MyP@ssw0rd

❌ マッチしない:

  • password (大文字・数字・記号なし)
  • PASSWORD123 (小文字・記号なし)
  • Pass123 (7文字・記号なし)

```

URL抽出

要件: テキストからURL を抽出

生成パターン:

```python

r'https?://(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)'

```

日本の電話番号

要件: 03-1234-5678 形式

生成パターン:

```javascript

/^0\d{1,4}-\d{1,4}-\d{4}$/

```

クレジットカード番号

要件: 16桁、スペース/ハイフン区切り対応

生成パターン:

```javascript

/^(?:\d{4}[-\s]?){3}\d{4}$/

```

テストケース:

```

✅ マッチする:

  • 1234 5678 9012 3456
  • 1234-5678-9012-3456
  • 1234567890123456

❌ マッチしない:

  • 1234 5678 901 (短い)
  • abcd-efgh-ijkl-mnop (英字)

```

パターン説明機能

入力:

```

^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d$

```

出力:

```markdown

このパターンは 時刻(HH:MM:SS形式、24時間制) にマッチします。

構造:

  1. ^ - 文字列の開始
  2. (?:[01]\d|2[0-3]) - 時(00-23)

- [01]\d - 00-19

- | - または

- 2[0-3] - 20-23

  1. : - コロン(区切り)
  2. [0-5]\d - 分(00-59)
  3. : - コロン(区切り)
  4. [0-5]\d - 秒(00-59)
  5. $ - 文字列の終了

マッチ例:

✅ 00:00:00

✅ 12:34:56

✅ 23:59:59

マッチしない例:

❌ 24:00:00 (24は無効)

❌ 12:60:00 (60分は無効)

❌ 1:2:3 (0埋めなし)

```

最適化機能

非効率なパターン:

```

/^[0-9][0-9][0-9][0-9]$/

```

最適化後:

```

/^\d{4}$/

```

改善点:

  • [0-9]\d に置換(短く読みやすい)
  • 繰り返しを {4} で表現

言語別パターン

JavaScript (ECMAScript)

```javascript

const emailRegex = /^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$/i;

const isValid = emailRegex.test(email);

```

Python

```python

import re

email_pattern = r'^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$'

is_valid = re.match(email_pattern, email, re.IGNORECASE)

```

Java

```java

String emailPattern = "^[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,}$";

Pattern pattern = Pattern.compile(emailPattern, Pattern.CASE_INSENSITIVE);

Matcher matcher = pattern.matcher(email);

boolean isValid = matcher.matches();

```

バージョン情報

  • スキルバージョン: 1.0.0
  • 最終更新: 2025-01-22

---

使用例:

```

以下の要件で正規表現を生成:

  • 日本の郵便番号(123-4567形式)
  • ハイフンあり・なし両対応
  • テストケース含む

```

パターン、説明、テストケースが生成されます!

More from this repository10

🎯
document-summarizer🎯Skill

Generates concise summaries of documents by extracting key information and condensing text into a more digestible format.

🎯
algorithmic-art🎯Skill

Generates creative algorithmic art using p5.js, creating unique visual designs with patterns, fractals, and dynamic animations.

🎯
sql-query-helper🎯Skill

Generates, optimizes, and explains SQL queries with best practices, providing intelligent database query solutions across multiple database platforms.

🎯
plantuml-diagram🎯Skill

Generates PlantUML diagrams (class, sequence, component) to visually represent system architecture and UML models.

🎯
azure-pipelines-generator🎯Skill

Generates Azure Pipelines YAML configurations automatically for CI/CD workflows, supporting multi-stage builds and deployments across different environments.

🎯
kubernetes-helper🎯Skill

Assists Kubernetes users by generating, validating, and explaining Kubernetes manifests and configurations with AI-powered insights.

🎯
using-git-worktrees🎯Skill

Creates isolated Git worktrees with smart directory selection and safety verification for feature work and branch management.

🎯
dependency-analyzer🎯Skill

Analyzes project dependencies, identifies potential conflicts, and provides insights into library compatibility and version management.

🎯
brainstorming🎯Skill

Collaboratively refines rough ideas into fully-formed designs through systematic questioning, alternative exploration, and incremental validation.

🎯
azure-boards-helper🎯Skill

Manages Azure Boards work items by creating, querying, and automating work item workflows using WIQL and comprehensive templates.