Strip comments but leave URI's which are in between ( and )
| From: | Mathijs | Date: | Mon, 06 Feb 2006 07:20:20 +0000 |
| Subject: | Strip comments but leave URI's which are in between ( and ) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-229921@lists.php.net to get a copy of this message | ||
Hello there,
I Have the following PREG.
I Want to remove comments from an file (Javascript or CSS), but i want to leave the URI's that are within an function.
So i thought to exclude any match which is between an ( and ).
But i can't seem to figure out exactly how.
I have the following atm:
\/\*.*?\*\/|\/\/(?!(w)).*?([\r\n])|[\t]+
I now exclude any // comment with an w besides this, but that isn't the solution.
Is there some way to have it exclude it when it is between ( and )?
Thx in advanced.