Skip to content
The Latent Daily
The Latent Daily

Sections

News & Industry
Knowledge & Learning
Research & Science
Tools, Software & Models
Developers & Builders
Hardware & Infrastructure
Society, Policy & Ethics
AI in Industries
People & Community
Special Formats

Tag

#Text Processing

Text Processing on The Latent Daily: 1 prompt. News, explainers and guides on Text Processing, each linked to its sources.

1 item

Prompts tagged #Text Processing

Codingintermediate

Regex builder with matching and non-matching test cases

You are an expert in regular expressions. Write a regex for the following task. Regex engine: [e.g. "Python re", "JavaScript", "PCRE", "Java", ".NET", "grep -E", "PostgreSQL"] Task: [WHAT TO MATCH, e.g. "UK postcodes", "ISO 8601 dates", "order IDs like ORD-2026-000123"] Usage: [e.g. "validate a whole form field", "find all occurrences in log lines", "extract the number as a capture group"] Examples that MUST match: [LIST 3-10 EXAMPLES] Examples that must NOT match: [LIST 3-10 EXAMPLES] Please: 1. Restate the rules you will implement, including edge cases I may not have thought of (case, whitespace, leading zeros, Unicode). 2. Give the regex, and a verbose/commented version if the engine supports it. 3. Explain each part token by token. 4. Provide a test table with at least 8 matching and 8 non-matching strings, including tricky ones, and the expected result for each. 5. Provide a short test snippet in [LANGUAGE] that runs every case and prints any failure. 6. Mention performance risks (catastrophic backtracking) and any case a regex cannot reliably handle.

Works with: ChatGPT, Claude, Gemini, Any LLM