Regex Validation Pitfalls

Use when a regular expression decides whether untrusted input is acceptable (validating an identifier, a path, a hostname, a redirect target, a header or a form field, or a pattern inside an allow-list, a route or a sanitiser config): matching the whole input, the anchors that differ between languages, a trailing newline slipping past the end anchor, alternation precedence and patterns that backtrack catastrophically.

techmefr Updated

File contents

techmefr/mentis commit 66e1eb4b94

Frequently asked questions

npx get-skill add techmefr/regex-validation-pitfalls