Reputation: 33
Is there an existing PL/SQL method which takes a string and returns the same string but with backslashes preceding any regexp chars?
Upvotes: 3
Views: 1675
Reputation: 21999
Try this:
result := REGEXP_REPLACE(subject, '([$^[()+*?{\|])', '\\\1', 1, 0, 'c');
Upvotes: 1