I need to specify the string find in Regex format, in order that head tag can be found whatever its format is like <html >
or <html>
or < html>
. How to specify the find string in Regex format?
String source = "<html >The quick brown fox jumps over the brown lazy dog.</html >";
String find = "<html>";
String replace = "";
Pattern pattern = Pattern.compile(find);
Matcher matcher = pattern.matcher(source);
String output = matcher.replaceAll(replace);
System.out.println("Source = " + source);
System.out.println("Output = " + output);