So I want to match a string to a simple mask but I would like to avoid using regex because my client have access to this mask and can change it.
Is it possible to have a string matches something like #####-000?
Or I have no choice but to convert my simple mask to regex ?
Thank you.
#means a number then just use it likeinput.matchs("#####-000".replaceAll("#","[0-9]"))which should result int the expression[0-9][0-9][0-9][0-9][0-9]-000. Ofc you could also count the#and replace the while sequence with like[0-9]{5}instead.