Is there a way to validate user input using YUP and restrict values that begin with '-', '+', or '_'?
Thank you for your help!
name: Yup.string()
.required()
.min(5, 'Too short')
.matches(/^[aA-zZ\s]+$/, "Only alphabets are allowed for this field ")
.matches()//code for checking wheather it starts with '+','-','_' if it starts I need to show an error
If you could provide the regex pattern for the following criteria:
- Minimum length of 5 characters
- No special characters allowed
- Cannot start with '-', '_', or '+'