If you want to remove all strings that are between the quotes in the style
attribute then a simple replaceAll()
should do the trick:
String input = "style=\"hello World\">One-time meetings< style=\"Hello Again\"> stop \"Hello\"";
input = input.replaceAll("style=\"(.*?)\"", "style=\"\"");
Update:
From inspecting your raw input, it appears that the quotes inside the <style>
tags themselves are already escaped by a single backslash. If this be the case, then the following replacement should give you what you want:
String input = "style=\\\"hello World\\\">One-time meetings< style=\\\"Hello Again\\\"> stop \"Hello\"";
input = input.replaceAll("style=\\\\\"(.*?)\\\\\"", "style=\\\\\"\\\\\"?");