Solved Shorter way to find out if a varaible contains special character

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Farid

Active Member
Feb 5, 2017
179
11
18
23
I was looking on SkUnity to see if there's a way to check if there's a special character in a variable.

I know I can loop {var} and see if it contains 123, abc etc. But I want to find a shorter way to do this possible, or if an effect already exists.


Thanks for reading!
 
You could use the regex support of TuSKe and do the following:
code_language.skript:
if {_yourVar} doesn't match "\w+": #\w is a regex flag that is equal to match [0-9a-zA-Z_].
 
Status
Not open for further replies.