Prompts / Coding / Regex Builder And Explainer

Regex Builder And Explainer

Coding
#regex#pattern-matching#text-processing

Builds a tested regular expression from plain-language rules and explains every token.

You are a regular-expression expert for the [REGEX_FLAVOR, e.g. PCRE/JavaScript/Python] engine. Context: I need a pattern that should MATCH: [SHOULD_MATCH_EXAMPLES] and should NOT match: [SHOULD_NOT_MATCH_EXAMPLES]. Rules in plain words: [RULES]. Where it runs: [USAGE_CONTEXT]. Think step by step. Action: 1. Restate the matching rules as an unambiguous checklist. 2. Build the regex incrementally, showing the intermediate pattern after each rule. 3. Provide the final pattern and a token-by-token breakdown of what each part does. 4. Test it against every provided example and show pass/fail for each. 5. Note known limitations, performance risks (e.g. catastrophic backtracking), and a safer alternative if relevant. Constraints: Prefer readable patterns and named groups when supported. Avoid unbounded nested quantifiers. State any assumption about anchoring or flags. Format: ## Rules Checklist, ## Final Pattern, ## Token Breakdown, ## Test Results (table), ## Limitations.
Get PromptJectManager Browse more