Test, validate and match regular expressions
Validates an input string allowing alphanumeric characters, common special symbols (such as @, #, $, *, etc.), spaces, and hyphens, with a length constraint between 2 and 20 characters. This is commonly used for input validation in forms to ensure usernames, passwords, or other text fields don't contain unexpected characters.