Hi All,
I want your advice on putting a constraint on integer field to limit it to 10 digits and accept 077/078/079 in the beginning like (0772314223) or (078121324) or (0799124355)
Please Advice,
Hi All,
I want your advice on putting a constraint on integer field to limit it to 10 digits and accept 077/078/079 in the beginning like (0772314223) or (078121324) or (0799124355)
Please Advice,
Try this:
constraint="regex(., '^07[7|8|9][0-9]{7}$')"
See Regular Expressions for details, and/or have a play around with regex's on https://regex101.com/
Description:
Hello guys
I have tried all your constraints concerning limiting the phone number digits to 10 but i hav failed. Ineed your help pleaseπ
hello @Joseph_Mugisha
use regex(., β^[0-9]{10}$β) on your constraints
Thank u it worked man
One way to do this is to use regular expressions in your code to validate the input.
You can use a regular expression like ""^(077|078|079)\d{7}$"" to match phone numbers starting with the specified prefixes and having 7 digits after that. It would ensure that only valid phone numbers are accepted in your integer field.