1Yup.object({
2 phone: Yup.string()
3 .required("This field is Required")
4 .matches(
5 /^((\\+[1-9]{1,4}[ \\-]*)|(\\([0-9]{2,3}\\)[ \\-]*)|([0-9]{2,4})[ \\-]*)*?[0-9]{3,4}?[ \\-]*[0-9]{3,4}?$/,
6 "Phone number is not valid"
7 )
8})
1const phoneRegExp = /^((\\+[1-9]{1,4}[ \\-]*)|(\\([0-9]{2,3}\\)[ \\-]*)|([0-9]{2,4})[ \\-]*)*?[0-9]{3,4}?[ \\-]*[0-9]{3,4}?$/
2
3phoneNumber: Yup.string().matches(phoneRegExp, 'Phone number is not valid')