Read a ton, didn't see an answer. Sorry if this is a duplicate.
Running PHP 5.4.
I have a form that takes Contact Info (name, email, number, etc).
The regex I would like is: only allow letters, numbers, a space, a dash, a backslash, a colon, an @ sign, and a forward slash.
This is what I'm using (for all input values, only showing one below):
if (!preg_match("/^[./\\@\w\sa-zA-Z0-9:-]+$/", $_POST["Name"])
I keep getting unknown modifier error. I don't care if the above is fixed, or replaced with a different regex, i just need to allow only the things i mentioned earlier.
Thanks in advance.