Hello everyone,
I am writing a constraint to validate local phone number's.
Maximum lenght (9 chars) and must start with (80,81,82,83,84,85,89,90,97,98,99). I've written the constraint manually and it works fine.
regex(.,'[1]{9}$') and starts-with(., 81) or regex(.,'[2]{9}$') and starts-with(., 82) or regex(.,'[3]{9}$') and starts-with(., 83) or regex(.,'[4]{9}$') and starts-with(., 80) or regex(.,'[5]{9}$') and starts-with(., 84) or regex(.,'[6]{9}$') and starts-with(., 85) or regex(.,'[7]{9}$') and starts-with(., 89) or regex(.,'[8]{9}$') and starts-with(., 90) or regex(.,'[9]{9}$') and starts-with(., 97) or regex(.,'[10]{9}$') and starts-with(., 98) or regex(.,'[11]{9}$') and starts-with(., 99)
I just have the feeling that it's not the right way. I would have liked to put the numbers in an array and call the array on validation.
If anyone has an idea to make the constraint better, I'd be very happy.
Thanks