How to check a string that contains special characters such as _ . , ( ) & ^ % $ # @ ! *
in my string?
I tried to create a regular expression validator for checking the string as follows.
bool isOk = Regex::IsMatch(firstname, "^[a-zA-Z]+$");
This is the name field in registration form. It should allow Japanese characters. But with my RegEx only allow English characters. I know this is because [a-zA-Z]
. But how to check only the special characters and leave Japanese or Korean characters?