I am trying to write a regex in Java to detect a decimal or a integer from a given text.
I have used the following pattern.
Pattern.compile("(\\d*\\.*?\\d*)%");
My intention is match occurences like 5%,0.5%,.5%,5.0%.
Is my pattern sufficient for all the matches ?