Regex for python float validation

4
  

r "[+ -]? \ d *.? \ d +"

This regex is accepting numbers with more than one point Ex: 12.23.43 and was not to accept ...

    
asked by anonymous 31.03.2017 / 18:23

1 answer

5

Try this:

r"^([+-]?\d+)(\.\d+)?$"

DEMO: link

    
31.03.2017 / 18:33