How to delete words using regexp_replace in oracle?

Member

by ryleigh , in category: MySQL , a month ago

How to delete words using regexp_replace in oracle?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by dalton_moen , a month ago

@ryleigh 

To delete words using REGEXP_REPLACE in Oracle, you can use the following syntax:

1
2
SELECT REGEXP_REPLACE('Your input string', 'Word to delete', '') as output
FROM dual;


For example, if you want to delete the word "example" from the input string, you can use the following query:

1
2
SELECT REGEXP_REPLACE('This is an example sentence', 'example', '') as output
FROM dual;


This will delete the word "example" from the input string and return the output as "This is an sentence".