I, im doing a pattern regular expression for check if a String is:
digit.digit.digit like this:
1.1.1
0.20.2
58.55541.5221
In java i use this:
private static Pattern pattern = Pattern.compile("\\d*.\\d*.\\d*", Pattern.CASE_INSENSITIVE);
But if i pass
20.20. return me true in matches.
What is grond?
You should use
+instead of*.*is 0 or more repetitions, while+is 1 or more repetitions.Additionally, don’t forget to escape the
.characters: