I want to split the string by space and with special characters if any. Ex: For expressing mobile switching center (signal strength).
Currently I am using the regex to split the string and I am not able to achieve both space and special characters split.
insert into tmp(word)
select regexp_substr('For expressing mobile switching center
(signal strength).', '(.*?)([[:space:]]|$)', 1, level, null, 1 ) as token
from dual
connect by level <= regexp_count('For expressing mobile switching center (signal strength).', '[[:space:]/:]+') + 1
CREATE TABLE TMP(WORD VARCHAR2(4000));
Current Output: For
expressing
mobile
switching
center
(signal
strength).
Expected Output: For
expressing
mobile
switching
center
(
signal
strength
)
.
Updated Code:
insert into tmp(word)
select regexp_substr('For expressing mobile switching center (signal strength).', '(.*?)([[:space:]()]|$)', 1, level, null, 1 ) as token
from dual
connect by level <= regexp_count('For expressing mobile switching center (signal strength).', '(.*?)([[:space:]()]|$)')+ 1
Result:
For
expressing
mobile
switching
center
(null)
signal
strength
.
(null)
(null)