What could be the regular expression to match below String
String str = "<Element>\r\n <Sub>regular</Sub></Element>";
There is a
carriage return "\r", new line character "\n" and a space after <Element>.
My code is as below
if(str.matches("<Element>([\\s])<Sub>(.*)"))
{
System.out.println("Matches");
}