Getting Started
Try RebbVal
Simply create a RebbVal
object and call val
function
// initialize a instance of Rebb Val
Valid v = new Valid();
// validates the input (100) is greater than 10(>10)
v.val(100,">10") // true
//or, is the input is less than 20?
v.val(100,"<20") //false
More validation rules
// if the input is greater than or equal to 18 and less then or equal to 60
v.val(50, "between 18 and 60") // true
// same as previous one, two dots represents a range
v.val(50, "[18..60]") // true
// greater than 18 and less than 60
v.val(60, "(18..60)" // false
// you can combine them
v.val(60, "(18..60]") //true
v.val(18, "[18..60)") //false
And you can combine two or more rules with and
and or
v.val(60, ">18 and <60") // false
v.val(60, ">18 or <60") // true
Last updated
Was this helpful?