I have the following:
if (mobile.matches("[0-9]{6,20}")) {
...
}
But would like to replace the {6,20} with variable values due to them been dynamic in some cases.
I.e.
int minValue = 11;
int maxValue = 20
if (mobile.matches("[0-9]{minValue,maxValue}")) {
...
}
How can I include variables in the Reg Exp?
Thanks
See Question&Answers more detail:os