I'd like to extract real numbers from a string in java. The string is circle(5.5) and I'd like to extract the 5.5. I think there is a way to do this with regex? but I'm not sure. Is there another way?
Asked
Active
Viewed 790 times
2 Answers
0
-
that only handles integers. When i tried it it returned 5 5 is there a way to get it to return 5.5? – Daniel Mar 09 '11 at 07:31
-
did you use this regex `(([0-9]+.[0-9]*)|([0-9]*.[0-9]+)|([0-9]+))` – ayush Mar 09 '11 at 07:33
-
that printed (5 then .5 on the next line – Daniel Mar 09 '11 at 07:40