Question:
Answer: give two examples to understand
Example 1:
SQL> select phone_number, 2 REGEXP_REPLACE(t.phone_number,'([[:digit:]]{3})\.([[:digit:]]{3})\.([[:digit:]]{4})', 3 '(\1)\2-\3') "PHONE_NUMBER" 4 from employees t; PHONE_NUMBER PHONE_NUMBER-------------------- --------------------------------------------------------------------------------515.123.4567 (515)123-4567515.123.4568 (515)123-4568515.123.4569 (515)123-4569590.423.4567 (590)423-4567590.423.4568 (590)423-4568590.423.4569 (590)423-4569
Example 2:
SQL> select phone_number, 2 REGEXP_REPLACE(t.phone_number,'([[:digit:]]{3})\.([[:digit:]]{3})\.([[:digit:]]{4})', 3 '(\2)\1-\3') "PHONE_NUMBER" 4 from employees t; PHONE_NUMBER PHONE_NUMBER-------------------- --------------------------------------------------------------------------------515.123.4567 (123)515-4567515.123.4568 (123)515-4568515.123.4569 (123)515-4569590.423.4567 (423)590-4567590.423.4568 (423)590-4568