问题 Suppose I have a string (varchar2) and I want to add a space wherever I have two consecutive a's. So for example: 'graanh' -> 'gra anh' . OK, this is trivial to do, either with replace or regexp_replace . But both choke on three or more consecutive a's. For example: SQL> select replace('aaaaa', 'aa', 'a a') from dual; REPLACE ------- a aa aa SQL> select regexp_replace('aaaaa', 'aa', 'a a') from dual; REGEXP_ ------- a aa aa This is because the search for the "next" occurrence of the match