Jump to content

Need HELP !


Dinossauro

Recommended Posts

probably use a regular expressions like so

  
username = 'whatever32$#@(*$59' 
if username:match('[a-zA-Z0-9]+') ~= nil then  
    print 'It is alright' 
else  
    print 'It contains illegal characters or is not long enough' 
end 
  

tested for syntax and functionality

the regex I used ([a-zA-Z0-9]+) means: allow any character in range of a-z, A-Z, underscores and 0-9 and require at least one of those with no maximum

check out RegExr to build and test your own regular expression

Link to comment
probably use a regular expressions like so
  
username = 'whatever32$#@(*$59' 
if username:match('[a-zA-Z0-9]+') ~= nil then  
    print 'It is alright' 
else  
    print 'It contains illegal characters or is not long enough' 
end 
  

tested for syntax and functionality

the regex I used ([a-zA-Z0-9]+) means: allow any character in range of a-z, A-Z, underscores and 0-9 and require at least one of those with no maximum

check out RegExr to build and test your own regular expression

Could add to this script code that prohibits the use of color codes?

Thank you.

Link to comment

Okay, I shall formulate it so it is better to understand or translatable by a machine:

Indeed. The code I have posted won't work instantly. Because you must replace the values I have set manually by functions such as guiGetText. Instead of the lines where I put "print", you must put the actual handling. Such as showing a pop-up window when the check fails. And when the check succeeds, put code so your server does things like SQL "INSERT"-commands. If you are checking if the username is okay in a client-side script, you also must put a trigger for the code on the side of your server (server-side). Because you can not use SQL-commands directly on the client-side.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...