> For the complete documentation index, see [llms.txt](https://willking.gitbook.io/rebb-val/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://willking.gitbook.io/rebb-val/zh-cn/master.md).

# 快速上手

## 一分钟学会RebbVal

初始化一个`RebbVal`对象，调用它的`val`方法，依次传入需校验的对象以及校验规则即可

```java
// 初始化一个RebbVal的实例
Valid v = new Valid();

// 校验一下100是否大于10（100>10)
v.val(100,">10") // true

//or, is the input is less than 20?
v.val(100,"<20") //false
```

我们来看看RebbVal还支持怎么样的校验规则

```java
// 50是否在18和60之间（包含18和60）
v.val(50, "between 18 and 60") // true
// [a..b]代表一个闭区间
v.val(50, "[18..60]") // true

// (a..b)为一个开区间
v.val(60, "(18..60)" // false
// 常见的Email验证
v.val("contact@example.com", "is email") //true
// 手机IMEI格式验证
v.val("35-209900-176148-1", "is IMEI") //false
```

{% hint style="info" %}
更多规则请参见规则列表
{% endhint %}

支持用`and` 和 `or`关键字来组合条件

```java
v.val(60, ">18 and <60") // false

v.val(60, ">18 or <60") // true
```
