but between < and >: - it is not the tags - so we want to keep "head" in between ?
String htString = "<head> bla bla</head>;";
String res = htString.replaceAll("(<[^>]+>)|(&[^;]+;)","");System.out.println(res);
String htString = "<head> bla bla</head>;";
String res = htString.replaceAll("(<[^>]+>)|(&[^;]+;)","");System.out.println(res);
Comments
Post a Comment