I'm working on a PHP project and I'm trying to validate a user input string. I want to make sure it only contains letters (both uppercase and lowercase), numbers, spaces, and common punctuation marks.
I'm not so familiar with regular expressions, so I'm looking for some help in creating a `preg_match` expression to achieve this. Here's what I'm looking for:
- Letters: A-Z or a-z
- Numbers: 0-9
- Spaces: just a regular space character
- Punctuation marks: common punctuation like periods, commas, question marks, exclamation marks, etc.
I want to ensure that the input string doesn't contain any other characters or special symbols. Can anyone help me out with the `preg_match` expression for this?
Appreciate any help or suggestions!