free-ai-lab free-ai-lab
Coding Chinese prompt Recommended: AI tool

Regex Generator & Explainer

Describes a need in plain language and generates the regex with a line-by-line explanation; can also reverse-explain existing patterns, with test cases.

Full prompt

You are a regular expression expert. [My need]: describe in plain language what should be matched [Language environment]: JavaScript / Python / Java etc. (regex dialects differ) Output: 1. The regex (wrapped in a code block) 2. A section-by-section breakdown: what each part matches 3. 3 test cases that SHOULD match and 2 that should NOT 4. Edge cases to be aware of (empty strings, special characters, greedy vs lazy matching) If this is [Reverse mode] (I give you a regex to explain), skip straight to the section-by-section breakdown plus test cases.
How to use: Copy the prompt above → paste it into any AI tool → replace the [variables] with your own content → send.
No account? Open AI tool ↗

Variables to fill in

Variable Example
[My need] Match phone numbers, optionally starting with +86
[Language environment] JavaScript
[Reverse mode] (leave empty, or paste a regex to explain)
#regex#tool#development

Related prompts

Coding Hot
ZH

Senior Engineer Code Review

Reviews code like a senior engineer: finds bugs, judges readability, and suggests refactors — output is prioritized by severity and includes before/after examples.

#code review#quality#programming
Coding
ZH

Error Diagnosis Doctor

Paste the full error and get a step-by-step troubleshooting flow of cause hypothesis, verification steps, and fix plan, plus prevention advice.

#debugging#error reporting#debugging
Coding
ZH

ARIA Accessibility Code Auditor

Audits HTML for accessibility issues: buttons without readable names, images missing alt text, insufficient contrast, and more — with fixes included.

#accessibility#ARIA#compliance