Parte 2·89g fa
Start with a contract table rather than one sample: input, should match, should not match, expected captures and reason. Decide whether the pattern finds a substring or must consume the full value, then set anchors and flags explicitly. Add one mutation at a time—empty input, Unicode, newline, repeated delimiter and a very long near-match. Run the final cases in the same regex engine used by the application because dialects differ. Keep the table as an automated regression test and include a performance limit for untrusted input.