Bug #2894 More regexp string functions

Submitted: 19 Feb 2004 9:00 Modified: 7 Oct 2005 18:52
Reporter: Ben Dilley Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version: OS:
Assigned to: CPU Architecture:Any

[19 Feb 2004 9:00] Ben Dilley
Description:
It strikes me that a lot of the string functions are crippled by their lack of regexp support. For example, I would like to write an update script which will do a regexp find + replace like so:

UPDATE docs 
SET text = RREPLACE(text, 'foo.*?bar', 'bar') 
WHERE text RLIKE 'foo.*?bar'

...but I can't. I appreciate that this probably opens up a can of worms, but it would be really useful!

How to repeat:
Try any regexp find + replace function at SQL level.

Suggested fix:
Add new string functions which mimic the existing ones, but use regex, e.g. RREPLACE(str, from_regex, to_regex)
[14 Mar 2005 18:12] Emanuele Dolis
Oh, yes, 
I was just typing the same - and since I've read that MySQL is going to change the regexp engine,  I think it could be the right time to fill this enormous gap - at least by starting providing a RXP_REPLACE or something like that.

Hope you're thinking of it - it it a critical function for data cleaning.

Thanks 
emanuele
[7 Oct 2005 18:52] Hartmut Holzgraefe
Duplicate of bug #1926

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.060 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.