If I have the string: ababa
and I want to replace any "aba" sequence with "c". How do I do this? The regular expression "aba" to be replaced by "c" doesn't work as this comes out as "cba". I want this to come out as "cc". I'm guessing this is because the second "a" in the input string is being consumed by the first match. Any idea how to do this?