if(preg_match(\'/[^a-z\\-0-9]/i\', $value)) { echo \"\"; }
how
The hyphen does not need to be escaped if it is the last character in the Regex group. But the dot should always be escaped, so
'/[^a-z\.0-9-]/i'
Will check for a to z, . , 0 to 9 and - in that order, case insensitively.