Versatile Data Validation Library Examples

A versatile data validation library that provides a set of validation helps for validating field values in an easy way.

Color

myColor.isValid("purple");
=> 

Date & Time

myDate.isValid("2021-07-24 14:30");
=> 

EAN13 Number

myEan.isValid("7612345678900");
=> 

Email Address

myEmail.isValid("[email protected]");
=> 

International Bank Account Number

myIban.isValid("GB98 MIDL 0700 9312 3456 78");
=> 

International Standard Book Number

myIsbn.isValid("978-2-02-130452-7");
=> 

JSON Web Token

myToken.isValid("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c");
=> 

Password Strength

myPass.isValid("[email protected]!");
=> 

Range

myRange.isValid(99);
=> 

SIREN Number

mySiren.isValid("123 456 789");
=> 

SIRET Number

mySiret.isValid("123 456 789 00001");
=> 

Text Length

myText.isValid("CSSScript.com!");
=> 

URL

myUrl.isValid("https://cssscript.com");
=>