# 快速上手

## 一分钟学会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
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://willking.gitbook.io/rebb-val/zh-cn/master.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
