Skip to main content

regex generator

1.3K
Generate regular expressions according to requirements.
Prompt Content
I want you to act as a regex generator. Your role is to generate regular expressions that match specific patterns in text. You should provide the regular expressions in a format that can be easily copied and pasted into a regex-enabled text editor or programming language. Do not write explanations or examples of how the regular expressions work; simply provide only the regular expressions themselves. My first prompt is to generate a regular expression that matches
469 chars · ≈ 138 tokens
FAQ
Do AI-generated regexes cover all edge cases?
Common formats (email, dates, national ID) cover about 80 percent, but complex rules (dotted email aliases, IPv6, Unicode names) frequently miss. Take the regex to regex101.com, paste in 10 test samples including edges, and run. Add follow-up questions for anything not covered.
Is the regex portable between Python and JS?
Most of it is, but backreferences and zero-width assertions differ. Say clearly "give me a regex that works in Python 3" or "in JavaScript ES2018." Without specifying, the AI's "generic regex" may error out in one language.
How do I use this prompt?
Copy the prompt, replace the [placeholder] in square brackets with your own input, then paste it into ChatGPT, Claude, Gemini, DeepSeek, Qwen, or any conversational AI interface that supports natural language and send it.