Actually the modified regex from @Panayotis
that supports multi-line subtitle text is like this:
protected static final String nl = "\\n";
protected static final String sp = "[ \\t]*";
Pattern.compile(
"(\\d+)" + sp + nl
+ "(\\d{1,2}):(\\d\\d):(\\d\\d),(\\d\\d\\d)" + sp
+ "-->" + sp + "(\\d\\d):(\\d\\d):(\\d\\d),(\\d\\d\\d)" + sp
+ "(X1:\\d.*?)??" + nl + "([^\\|]*?)" + nl + nl);
Replace ([^\\|]*?)
with any character which have less probability to come as subtitle text. I have currently used "|" character negation rule.