Please help me to get efficient way to find Numeric String.
String str ="-100000.000";
System.out.println(str.matches("-?\\d+(\\.\\d+)?"));
it works perfectly but I want to accept Numeric Strings like this
String length must be maximum (10,3)--- Example 1234567890.999
String length must be minmum (1)------0
Numeric String must be positive.
valid Numeric Strings(2.333 1878.12 787 989.0)
Given your restrictions, you can use this regex:
You can look at the quantifiers section in JavaDoc.
Added the optionally leading
+, as per your request in the comment.