I found this line of code:
preg_replace("/^[^a-z0-9]?(.*?)[^a-z0-9]?$/i", "$1", $word);
How can I change it to strictly remove only boolean operators that occur at the beginning or at the end of the $word.
These are the boolean operators to remove:
+ - > < ( ) ~ * '(single quotes) "(double quotes)