sql - Oracle Regexp - substr by multiple spaces but not single space -


lets have string-

"a   b      cc  d d  e" 

i'd able

regexp_substr('a   b      cc  d d  e', ??, 1, 4) 

and have return "d d".

i using "[^ ]+" pattern, splits single spaces don't want.

i think want:

select regexp_substr(col, '([^ ]*[ ]?[^ ]+)+', 1, 4) 

Comments