I'm working with RegEx on Java and here is where I stuck.
I have a simple string like
String sample1 = "word 231 sadas aslkjasf anything ORDER what whut ASC hello ORDER whatever."
I have to find every substring until the last occurrence of ASC
between two ORDER
s and replace them with word QQQ
.
Here are some examples:
String sample1 = "word 231 sadas aslkjasf anything ORDER what whut ASC hello ORDER whatever.";
String result1 = "word 231 sadas aslkjasf anything QQQ hello ORDER whatever.";
// replaced "ORDER what whut ASC"
String sample2 = "word 111 sadas anything ORDER what whut yeap ASC nope ASC maybe ORDER yeah.";
String result2 = "word 111 sadas anything QQQ maybe ORDER yeah.";
// replaced "ORDER what whut yeap ASC nope ASC"