Home > Back-end >  Oracle regexp_replace default replace string
Oracle regexp_replace default replace string

Time:11-19

I have a simple question I cant find the answer for:

Is this:

regexp_replace(somecolumn, someregex) 

The same as the following?

regexp_replace(somecolumn, someregex, NULL) 

CodePudding user response:

Yes, they're the same. The documentation for REPLACE is more explicit about this behavior:

If replacement_string is omitted or null, then all occurrences of search_string are removed.

But REGEXP_REPLACE behaves the same way. The third argument replace_string replaces whatever matches the pattern; if it's omitted or null, all matching parts of the string are removed.

  • Related