I'm using the following regular expression found in this post: (?<=\s)\s+(?![^<>]*)
When I do this:
echo gzencode( trim( preg_replace('/(?<=\s)\s+(?![^<>]*<\/pre>)/', '', $html) ), 9);
The spaces are replaced in all html. even inside pre tags. I need this to compress the entire page.