The fix is to use DOTALL mode for the regex, and for good measure, to ensure the match is up to the end of the line.
JBS: https://bugs.openjdk.java.net/browse/JDK-8182611 The one-line fix is in the comments for the JBS issue: https://bugs.openjdk.java.net/browse/JDK-8182611?focusedCommentId=14094548&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14094548 -- Jon