OpenSSF publication
Correctly Using Regular Expressions for Secure Input Validation
Also known as: USEREGEXGUIDE
Regular expressions (aka regexes) can be a great way to validate input against specialized patterns. They’re widely available, widely understood, flexible, and efficient. However, they must be used correctly.