Improve handling compressed content and bad regexps

Signed-off-by: Raul Gutierrez S <rgs@itevenworks.net>