This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The regular expression used to match comments in HTTPXHTMLResource.java is defined as: Pattern.compile("(<!-- .* -->)", Pattern.MULTILINE); This is incorrect because: 1. "." does not match new lines unless the Pattern.DOTALL is also set 2. regular expression are greedy in Java, meaning that if there is one comment at the beginning of the document and one comment at the end, the regular expression will just match the entire document between the beginning of the first comment and the end of the second one 3. There may be no space between the beginning and the end of the comment, i.e. "<!--comment-->" is a valid comment. The correct regular expression should rather be: Pattern.compile("(<!--.*?-->)", Pattern.MULTILINE | Pattern.DOTALL);
Fixed regular expression in HTTPXHTMLResource.java