It's fairly easy, since you are using a character class:
Code:
$pattern = "/\band\b|\bor\b|[ '#=+\"%$!,\]]/i";
Inside the char class definition the space itself is sufficient. ALso, there is no need to escape meta characters inside a char class definition unless they would interfere with the syntax of the whole expression. Therefore, just the right square bracket and the double wuote need escaping.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.