Allowing certain inputs (like masks) based on a regex pattern