My idea is something like this but I dont know the correct code
if (mystring.matches(\"[0-9.]+\")){ //do something here }else{ //do something here } <
if (mystring.matches(\"[0-9.]+\")){ //do something here }else{ //do something here }
I create myself to solve exactly question's problem. I'll share you guys the regex:
^(\d)*(\.)?([0-9]{1})?$
Take a look at this Online Regex to see work properly
Refer documentation if you wish continue to custom the regex
Documentation