Poring King Posted September 5, 2020 Group: Members Topic Count: 63 Topics Per Day: 0.02 Content Count: 1016 Reputation: 191 Joined: 11/27/14 Last Seen: February 15 Share 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 Link to comment Share on other sites More sharing options...
0 Songbird Posted September 9, 2020 Group: Members Topic Count: 2 Topics Per Day: 0.00 Content Count: 20 Reputation: 7 Joined: 08/05/16 Last Seen: Friday at 09:47 AM Share 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 Link to comment Share on other sites More sharing options...
0 Poring King Posted September 13, 2020 Group: Members Topic Count: 63 Topics Per Day: 0.02 Content Count: 1016 Reputation: 191 Joined: 11/27/14 Last Seen: February 15 Author Share 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 Link to comment Share on other sites More sharing options...
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
Link to comment
Share on other sites
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.