oracle regex_replace
时间: 2023-07-09 21:48:09 浏览: 41
Oracle's `REGEX_REPLACE` function is used to replace occurrences of a regular expression pattern in a string with a replacement string. The syntax is as follows:
```
REGEX_REPLACE(source_string, pattern, replacement_string [, start_position [, occurrence [, match_parameter ]]])
```
- `source_string`: the string to search and replace.
- `pattern`: the regular expression pattern to match.
- `replacement_string`: the replacement string.
- `start_position` (optional): the position in the source string to start the search.
- `occurrence` (optional): the occurrence of the pattern to replace. By default, all occurrences are replaced.
- `match_parameter` (optional): additional matching options.
Here is an example:
```
SELECT REGEX_REPLACE('Hello, World!', '[aeiou]', '*') AS replaced_string
FROM dual;
```
This query will replace all vowels in the string 'Hello, World!' with asterisks, resulting in the output: 'H*ll*, W*rld!'.