--REGEXP_LIKE Determine whether pattern matches
SELECT * FROM ps_names WHERE REGEXP_LIKE(NAME,'-')
--REGEXP_SUBSTR Determine what string matches THE pattern
SELECT EMPLID, REGEXP_SUBSTR(NAME,'-') FROM ps_names
SELECT EMPLID, NAME FROM ps_names WHERE REGEXP_SUBSTR(NAME,'-') <> ' '
--REGEXP_INSTR Determine WHERE THE match occurred IN THE string
SELECT EMPLID, REGEXP_INSTR(NAME,'-') FROM ps_names
SELECT EMPLID, NAME FROM ps_names WHERE REGEXP_INSTR(NAME,'-') > 0
--REGEXP_REPLACE Search AND REPLACE a pattern
SELECT emplid, PHONE, REGEXP_REPLACE(PHONE, '([[:digit:]]{3})([[:digit:]]{3})([[:digit:]]{4})','(\1) \2-\3') "REGEXP_REPLACE"
FROM ps_up_phone_cell
SELECT * FROM ps_names WHERE REGEXP_LIKE(NAME,'-')
--REGEXP_SUBSTR Determine what string matches THE pattern
SELECT EMPLID, REGEXP_SUBSTR(NAME,'-') FROM ps_names
SELECT EMPLID, NAME FROM ps_names WHERE REGEXP_SUBSTR(NAME,'-') <> ' '
--REGEXP_INSTR Determine WHERE THE match occurred IN THE string
SELECT EMPLID, REGEXP_INSTR(NAME,'-') FROM ps_names
SELECT EMPLID, NAME FROM ps_names WHERE REGEXP_INSTR(NAME,'-') > 0
--REGEXP_REPLACE Search AND REPLACE a pattern
SELECT emplid, PHONE, REGEXP_REPLACE(PHONE, '([[:digit:]]{3})([[:digit:]]{3})([[:digit:]]{4})','(\1) \2-\3') "REGEXP_REPLACE"
FROM ps_up_phone_cell
Comments
Post a Comment