gezel Gezel Handboek

Build + Test a Tricky Regex

Build a regular expression that matches exactly the right strings and rejects the wrong ones — specified with concrete should-match and should-NOT-match cases before a single character is written. Specs the cases FIRST — the positive examples, the tricky negative examples, edge cases, and the anchoring/flags — then builds the regex incrementally against those cases, then tests the full matrix including catastrophic-backtracking safety. Covers character classes, quantifiers, anchors, groups/captures, lookahead/behind, escaping, flags, and ReDoS-safe patterns validated by a should-match / should-not-match table.

How it runs

#StepWho runs itWhat happens
1Spec the casesPlannerlock should-match / should-NOT-match examples
2Build the regexDeveloperconstruct the pattern against the cases
3Test the matrixDevelopertest every match/no-match case + ReDoS safety
4EvaluateReviewerGrade the deliverable against every acceptance criterion. All pass → finish; any fail → loop back and fix the gap.
5FinishDeveloperAll acceptance criteria met. Stamp a short summary and report DONE.

Say something like "build a regex" or "write a regular expression" or "match a pattern" or "validate with regex" or "tricky regex" in chat to start it.

Watch this article as a slideshow