Regular expressions for float values and coordinates

I was working with some pixel values the other day and I had this problem; I’m getting an RGBA value from my object model but it returns it on a string format (ie: 0, 1, 1, .5). For this specific task I only cared about the alpha value so I figured writing a regular expression…

1