Bug #44284 Strings process with REGEXP
Submitted: 15 Apr 2009 9:38 Modified: 4 Nov 2019 19:30
Reporter: Guillaume Ballet Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: DML Severity:S4 (Feature request)
Version: OS:Any
Assigned to: CPU Architecture:Any

[15 Apr 2009 9:38] Guillaume Ballet
Description:
A very usefull feature would be to be able to process a string with REGEXP. Knowing if a pattern is found in a string is good, process the string depending of the pattern is better. For example something like select '2d 11mm 46s E' REGEXP "([0-9]*)s" should return 46 (in $1) and select '2d 11mm 46.12s E' REGEXP "([0-9]*\.[0-9]*)s" should return 46.12 (in $1). Would be GREAT ! I mean, this is exactly the way Perl handle REGEX... str =~ s/([0-9]*\.[0-9]*)s/$1

How to repeat:
select '2d 11mm 46s E' REGEXP "([0-9]*)s" -> 1

Suggested fix:
select '2d 11mm 46s E' REGEXP "([0-9]*)s" -> 46
[16 Apr 2009 6:22] Valeriy Kravchuk
I think this is a duplicate of bug #1926. Please, check.
[17 Apr 2009 16:08] Guillaume Ballet
idem bug #1926. 
But cannot find sources for the lib !!!
[19 Apr 2009 12:34] Valeriy Kravchuk
Check http://udf-regexp.php-baustelle.de/trac/, please.
[23 Apr 2009 12:03] Guillaume Ballet
Yes ! but the following links to nothing...
http://udf-regexp.php-baustelle.de/trac/trac/downloads

Help me please,

Regards,

Guillaume
[13 Jul 2009 9:25] Susanne Ebrecht
Many thanks for a reasonable feature request.
[2 Nov 2019 14:25] Roy Lyseng
Posted by developer:
 
Implemented in 8.0 as the function REGEXP_SUBSTR.
[4 Nov 2019 19:30] Guillaume Ballet
Thanks!