use regex to keep only alphanumeric code example
Example 1: regex to identify numeric and alphanumeric
"^[a-zA-Z0-9_]*$"
Example 2: regex allow alphanumeric and special characters
/^[ A-Za-z0-9_@./#&+-]*$/
"^[a-zA-Z0-9_]*$"
/^[ A-Za-z0-9_@./#&+-]*$/