I set two flags for a text string, I hope to replace all the content between the flag <!--BeginOfReplace-->
and the flag <!--EndOfReplace-->
.
I think the regular expressions can do it, how can I write a code in Java? Thanks!
Text String
This is a cup
<!--BeginOfReplace-->
Hello, world !
<!--EndOfReplace-->
I will go back.