Hi guys,
I'm relatively new to PHP and I want to create a preg_match statement that searches for numbers and special characters.
Currently I have.
preg_match("/([0-9])|(\"|}|{|!|@|£|\$|%|^|\&|()|\?||||[|]|-|\=|+|\§|\±)/", $string))
I want to use this as part of my form checking to ensure that no special characters are entered as a user name. I only want to accept characters that are either a-z or - or – or '. I want to detect any thing outside of this. I was told preg_match was the way to do it.
If someone could either suggest a better way of doing this that would be great.