If string dosen't only contain letters

I wanna set a players name. But he/she is not allowed to have symbols or numbers.

if string.contains symbols and numbers then

[lua]string.match( ply:Nick(), “[A-Za-z0-9]+” ) == ply:Nick()[/lua]
Returns true if the player’s name is valid

This is kinda confusing way to do it. I think this is better:

if ply:Nick():find("[^a-zA-Z]") then … end

It may also be worth adding in \s and - to allow for names that have spaces or double-barrelled/ hyphenated names.

Otherwise you’re stuck to single word names. Which is somewhat boring.

I fully agree that it would be better, but I just did what the guy asked. Maybe he doesn’t want spaces/hyphens for some weird reason.

Also it’s %s in Lua patterns instead of \s like in regexp.