Número do veículo Regex

Yup.string()
      .required("Vehicle Number is Required")
      .test(
        "vehicleNumber",
        "First two letters of the vehicle number should be capitalized and followed by a space, then the vehicle number should be in the format of 'AB 1234' or 'AB 1234 CDE'",
        (value) => {
          return /^[A-Z]{2}[ -][0-9]{1,2}(?: [A-Z])?(?: [A-Z]*)? [0-9]{4}$/i.test(
            value
          );
        }
      ),
Aliva Priyadarshini