I want the regex to deactivate my data, which must meet the following condition
a) a-z and A-Z allowed
b) 0-9 allowed
c) Special Symbols like Comma (,) dot (.) question Mark (? allowed)
d) Single Space is allowed
I tried and came up with this
preg_replace('%[^a-zA-Z0-9,.?\s]%', '', $string);
I am not very familiar with RegExp, although the code above works, I would like to know
a) if I use the correct RegExp syntax?
b) if I do not use modulus(%)at the beginning and end of the syntax there will be no work, and I have no idea what the purpose of the module is here?
source
share