Bug #16357 add in functions to do regular expression replacements in a select query
Submitted: 10 Jan 2006 23:09 Modified: 28 Oct 2019 22:57
Reporter: Edward Rudd Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: DML Severity:S4 (Feature request)
Version:future OS:Any (all)
Assigned to: CPU Architecture:Any

[10 Jan 2006 23:09] Edward Rudd
Description:
Currently there are several non-regular expression string functions, but no regular expression string functions, only regular expression string comparison functions.

I would like some regular expression manipulation functions ie. 

SELECT name, pcre_replace('/([0-9]{3}).*([0-9]{3}).*([0-9]{4})/','$1-$2-$3',phone) AS phone FROM mytable

How to repeat:
N/A
[11 Jan 2006 7:28] Valeriy Kravchuk
Thank you for a useful feature request. Yes, something similar to s/re1/re2/ command of ed and others will be really useful.
[28 Oct 2019 22:57] Roy Lyseng
Posted by developer:
 
Implemented as WL#8987