hi pls explain me clearly how operaters in regexp works.
SELECT REGEXP_INSTR('500 Oracle Pkwy, Redwood Shores, CA', '[o][[:alpha:]]{4}', 1, 1, 0, 'i') RESULT
FROM dual
0/p is----> 5
WITH t AS
(SELECT '123-4567' phone FROM dual
UNION
SELECT '01 345678' FROM dual
UNION
SELECT '7 87 8787' FROM dual)
SELECT t.phone, REGEXP_REPLACE(REGEXP_REPLACE(phone, '[^0-9]'), '(.{3})(.*)', '(\1)-\2')
FROM t
o/p is -->
PHONE REGEXP_REPLACE(REGEXP_REPLACE(
01 345678 (013)-45678
123-4567 (123)-4567
7 87 8787 (787)-8787
Thanks in advance.