Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

vehicle number yup validation

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
          );
        }
      ),
Comment

PREVIOUS NEXT
Code Example
Javascript :: backgroundcolor react 
Javascript :: how to get parameter url js 
Javascript :: javascript countdown 10 seconds 
Javascript :: js replace all substrings 
Javascript :: javascript MAX INT and MIN INT 
Javascript :: regex check from a-z 0-9 
Javascript :: if variable does not exist javascript 
Javascript :: update data firebase firestore javascript 
Javascript :: how to return character associated to character code javascript 
Javascript :: react canvas clear 
Javascript :: material ui disable textfield 
Javascript :: vue go to particular route 
Javascript :: jquery load event 
Javascript :: pick random from array 
Javascript :: random number generator javascript 
Javascript :: angular generate directive 
Javascript :: ERR_REQUIRE_ESM 
Javascript :: number format in javascript 
Javascript :: alias import javascript 
Javascript :: jquery ajax while loading 
Javascript :: replace object in array javascript 
Javascript :: find element in array javascript 
Javascript :: react construct 
Javascript :: jquery get textarea text 
Javascript :: angular local storage 
Javascript :: sum of number using reduce 
Javascript :: how to copy text in js 
Javascript :: spacebar event listener 
Javascript :: vue watch immediate 
Javascript :: nodejs recursively read directory 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =