I am creating a small replaceParam function for Strings and wanted to be able to escape a replacement, e. g.

```
select regexp_replace('%ABC# %ABC#','%ABC#', 'XXX')
from dual;

```

leads to

```
XXX XXX

```

BUT I want to be able to escape the replacment, e. g. by preceding a \ in front of a string, that would be otherwise replaced.

```
select regexp_replace('%ABC# \%ABC#','<themagicregexp>', 'XXX')
from dual;

```

should lead to

```
XXX \%ABC#

```

I tried the non-matching character list, but this doesn't work.

```
select regexp_replace('%ABC#abc\%ABC#','<themagicregexp>', 'XXX')
from dual;

```

should lead to

```
XXXabc\%ABC#

```

In addition because someone mentioned it: I can't go with word boundaries, since this should work also:

```
yoyo%ABC#yoyo

```

I have the feeling this can be done in one regexp, but I just don't see it?