I have the following RegEx to remove commentary from a PHP file: %/\*.*?\*/%s
The side effect is, that on use of glob
like glob($basedir . '/*')
it starts removing everything midcode...
So how do I tell the regex to not match when there are quotes in front of it or behind it?
Try this :
%[^'"]{1}/\*.*?\*/[^'"]{1}%s
It include not simple or double quote before /* and after */