I'm trying to strip a string of all sequences that begin with a string "GUGU" and and end with something like "AGAG". The closest I've gotten is
replaceAll("GUGU(.*)AGAG", "")
but all that does is replace the "largest" instance. Meaning if there are multiple occurrences of GUGU*AGAG in a string, it only matches the outermost. So what could I do to get this to work for every instance of the regex in the string?