Backreferences for salvation:
select regexp_replace('4455599', '((.)\2*)', '\1 ') from dual;
Output:
44 555 99
Explanation
((.)\2*) defines two capture groups, where:
(.) matches any single character and commits it to group 2.
\2* is a backward reference to a character recorded in group 2 that matches the same character zero or more times.
((.)\2*) therefore corresponds to a sequence of one or more of the same character and captures the sequence in group 1.
\1 replaces characters matching the contents of group 1 followed by a space.
Backreferences are counted from left to right, starting at 1 (group 0 is a complete match). So, if you have a pattern (((a)b)c)d , the innermost (a) is group 3, ((a)b) is group 2, (((a)b)c) is a group 1, and if you use the regular regex engine (not the oracle), the whole pattern (((a)b)c)d is fixed in group 0.
Test cases
select val, regexp_replace(val, '((.)\2*)', '\1 ') as result from ( select '445559944' as val from dual union all select 'bb119911' as val from dual union all select '46455599464' as val from dual ) foo;
Output:
VAL RESULT ----------- ------------------ 445559944 44 555 99 44 bb119911 bb 11 99 11 46455599464 4 6 4 555 99 4 6 4
source share