cookiejar
asked on
Ensure a passed string is alphanumeric
Could you please give me a method to determine if a string is alphanumeric and how to throw and error if not.
For example, I am passed a string and it is used in a select statement as the table name. If any strange characters are in the table name, the SQL will error out.
For example, I am passed a string and it is used in a select statement as the table name. If any strange characters are in the table name, the SQL will error out.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Effectively the same as i posted
:)
ASKER
"(\\p{Alnum}|_)+"