I want to check if my number matches a regex pattern.
What I want to achieve is to make a check if a number matches the pattern and than execxuting code.
My if statement is the following:
public String refactorNumber(String input){
if(input.matches("#,##0.##")) {
//execute code
}
}
But it never matches, my input numbers are:
- 0
- 100
- 1,100.01
What am I doing wrong?