I have this function:
!preg_match("/^[a-zA-Z\. ]*$/", $home)
How I can correctly add numbers 0-9 in here ?
Thanks Toni.
You want the text to consist of 0 or more alphabetics, digits, periods (dots), and blanks (ASCII x20)?
/^[a-z0-9. ]*$/i
is one way. Notice that you do not need to escape the period within a class. You may be able to use "shortcuts" such as \w, but the above is short and understandable. If you want any whitespace, including tabs, replace the blank with \s. You can add an "s" flag to treat endlines as whitespace.