From: Manuel Carrasco MoƱino Date: Mon, 18 Nov 2013 10:04:59 +0000 (+0100) Subject: Better and faster regex X-Git-Tag: release-1.4.0~31^2~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b6594da1ad975dcd5252cbc619020293bb44d0e1;p=gwtquery.git Better and faster regex --- diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsniBundleGenerator.java b/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsniBundleGenerator.java index 8328d811..7e5ea15c 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsniBundleGenerator.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsniBundleGenerator.java @@ -92,7 +92,7 @@ public class JsniBundleGenerator extends Generator { // remove MS .replace("\r", "") // remove 'c' (/* */) style comments blocks - .replaceAll("(\\s*/\\*[\\s\\S]*?\\*/\\s*)", "\n") + .replaceAll("/\\*(?>(?:(?>[^\\*]+)|\\*(?!/))*)\\*/", "") // remove 'c++' (//) style comment lines .replaceAll("(?m)^\\s*//.*$", "") // remove 'c++' (//) style comments at the end of a code line