Check strings which should only contain some characters.
In my case, there are some strings like "NAME_ID", "EMPLOYEE_ID" etc, which should only contain some characters from A to Z (both upper case and small letter) and "_". Currently, there is only one method in my mind of checking if the string only contains above mentioned characters, i.e. using strstr to check it one character by another, which is obviously costive. Therefore, may I happen to know if there is a better way of doing that? Or I have to use the regular expression (from third party, not in C)to do it?