Im writing this code into which the user enters a string containing numbers, for example.
H3.07LLo my nam3 is bob12
And the way out should be
3.07, 3.0, 12.0
I managed to get a regex to look for doubles, but I don't know how to look for ints. this is my regex:
(-)?(([^\\d])(0)|[1-9][0-9]*)(.)([0-9]+)
I am new to regex. I tried adding |[0-9]|, but I keep messing it up, wherever I put it in the current regex
source
share