Poring King Posted September 5, 2020 Posted September 5, 2020 Hello is there a way to check if there is a special character in input ? I tried "If (compare())" condition . Can you give me idea how properly check if there is a special character with in input Quote
0 Songbird Posted September 9, 2020 Posted September 9, 2020 Try using *preg_match(<regular expression pattern>,<string>{,<offset>}) Searches a string for a match to the regular expression provided. The offset parameter indicates the index of the string to start searching. Returns offsets to captured substrings, or 0 if no match is found. This command is only available if the server is compiled with the regular expressions library enabled. Something like this could work: if (preg_match("^[a-zA-Z0-9]+$",.@yourString$) { // This means it found a coincidence, meaning that no symbols where fund } else { // No matches, symbols where found } 1 Quote
0 Poring King Posted September 13, 2020 Author Posted September 13, 2020 @Songbird I read this on script_commands.tx . I guess i did not really understand this on txt file . But right now i understand this Thankyou! Quote
Question
Poring King
Hello is there a way to check if there is a special character in input ? I tried "If (compare())" condition . Can you give me idea how properly check if there is a special character with in input
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.