Issue
I thought it may be [.\n]+
but that doesn't seem to work?
Solution
The dot cannot be used inside character classes.
See the option href="http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html#DOTALL" rel="noreferrer">Pattern.DOTALL.
Pattern.DOTALL
Enables dotall mode. In dotall mode, the expression.
matches any character, including a line terminator. By default this expression does not match line terminators. Dotall mode can also be enabled via the embedded flag expression(?s)
. (The s is a mnemonic for "single-line" mode, which is what this is called in Perl.)
If you need it on just a portion of the regular expression, you use e.g. [\s\S]
.
Answered By - Artefacto
Answer Checked By - David Marino (JavaFixing Volunteer)