Write a title that summarizes the specific problem
I try to using matches of yup but it working incorrectly. My require is Code is not case-sensitive. It can contain alphanumeric and special characters, except for "<", ">", and "&#".
My yup validation is: yup .string() .required(VALIDATE_MESSAGE.FIELD_IS_REQUIRED) .matches(/^(?!.*(&#|<|>)).+$/, 'Code contains invalid characters!')
=> when I try enter value is "123&" it return false
But when I try on console log it return true /^(?!.*(&#|<|>)).+$/.test("123&") => true
yup .string() .required(VALIDATE_MESSAGE.FIELD_IS_REQUIRED) .matches(/^(?!.*(&#|<|>)).+$/, 'Code contains invalid characters!')
=> when I try enter value is "123&" it return false But when I try on console log it return true/^(?!.*(&#|<|>)).+$/.test("123&")
=> trueAnyone can help me. Thanks
Here is regex site check: https://regex101.com/r/4NjakU/1