MacResource
REGEX extraction in MySQL? - Printable Version

+- MacResource (https://forums.macresource.com)
+-- Forum: My Category (https://forums.macresource.com/forumdisplay.php?fid=1)
+--- Forum: Tips and Deals (https://forums.macresource.com/forumdisplay.php?fid=3)
+--- Thread: REGEX extraction in MySQL? (/showthread.php?tid=88723)



REGEX extraction in MySQL? - Greg - 11-30-2009

table1.vals
$100.43
20
20,123
4,128.43

I want to return everything that's either digits or dots. That is, ([0-9]|\.)

It seems that the built-in REGEX function only returns whether a pattern is matched; it doesn't do extraction.

Can this be done?

Thanks!

Greg


Re: REGEX extraction in MySQL? - Seacrest - 11-30-2009

I don't think it can be.
Maybe with a custom function or stored proc, but that might involve writing a full regex implementation, which seems like overkill.