java - RegEx Pattern that matches positive or negative values (e.g "1.2", "-2.8", "7.8", -22.8") -


The decimal separator is a point, then maximum one digit! No limit specified.

Thanks guys!

  ^ -? \ If the decimal part is optional and  
  ^ -? \ D + \. \ D $  

code>

if this is needed :)


Comments