AiPromptss
Back to browse

Regex Builder & Explainer

Build and explain a regex for a specific matching task.

Added May 11, 20260 views0 copies
Prompt
Act as a regex expert.

I want a regex that matches: [DESCRIBE_PATTERN]
It should NOT match: [DESCRIBE_NON_MATCHES]
Regex flavor: [JavaScript / Python / PCRE / etc.]
Example inputs that should match:
- [EXAMPLE_1]
- [EXAMPLE_2]
Example inputs that should NOT match:
- [EXAMPLE_3]
- [EXAMPLE_4]

Output:
1. The regex pattern
2. A character-by-character breakdown of what each part does
3. A version of the regex commented inline (using x-flag style) for clarity
4. Sample usage code in [LANGUAGE]
5. 3 edge cases this regex might fail on, and how to handle them

Replace text in [BRACKETS] with your own values before pasting.