Regex Validation Architect

What This Prompt Does:

Generate complex Regular Expression patterns without the headache. Whether you need to validate custom IDs, international phone numbers, or complex passwords, this prompt builds it for you.

Key Tips for Best Results:

  • Provide 5 examples of valid strings and 5 examples of invalid ones.
  • Specify the regex engine (JavaScript, Python, PHP, etc.).
  • Ask for an explanation of each part of the generated pattern.

Description

About This Prompt: Regex Validation Architect

Optimized for:
ChatGPT
Claude
Gemini
Grok
Verified precision.

How To Use The Prompt:

  1. Copy the entire prompt from the window and paste it directly into ChatGPT, Claude, or Gemini.
  2. Locate and replace the main placeholders with your specific details: [VALIDATION RULES], [STRING EXAMPLES], and [REGEX ENGINE].
  3. Input Example: Use the following format for your input:

Example Input: Rule: 8-digit ID starting with 'PRO', Example: PRO-12345, Engine: JavaScript.

Additional Information:

Regex is notoriously difficult to get right on the first try. This prompt ensures your patterns are precise and performant.

This prompt provides the foundation to:

  • Precision: Eliminates ‘false positives’ in your input validation.
  • Readability: Provides a breakdown of what every slash and bracket does.
  • Cross-Language: Tailors the syntax to your specific programming environment.

Safety Note: As a professional colleague, always review AI-generated assessments for potential bias or inaccuracies before making final business or management decisions.

PROMPT WINDOW

You are a Regex Master and Senior Developer. Your task is to construct a Regular Expression for the following [REGEX ENGINE] environment.

The expression must satisfy these [VALIDATION RULES].

Here are some [STRING EXAMPLES] that should pass and some that should fail. Provide the final regex pattern, a detailed breakdown of the logic, and a brief unit test example.