> For the complete documentation index, see [llms.txt](https://docs.docbits.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.docbits.com/chinese/guan-li-yu-she-zhi/setup/document-types/regex-manager.md).

# Regex Manager

DocBits 的此功能可作为模型分类的替代方案，让您为文档类型编写可搜索的正则表达式，用于分类及其他用途。

文档类型：Regex Manager 允许您编写正则表达式，随后系统会在文档中搜索该表达式。如果找到与某个已定义文档类型的正则表达式匹配的内容，系统就会将该文档分类为相应的文档类型。例如，您可以编写一个用于查找“Gutschrift”的正则表达式。如果 DocBits 在文档中找到这个词，就会将该文档分类为贷项通知单。

文档来源：通过正则表达式，DocBits 可以识别文档的来源国家。例如，如果西班牙文档的正则表达式包含“Factura”一词，DocBits 搜索文档并找到该词后，就会识别该文档来自西班牙，并据此进行分类。

## **访问 Regex Manager**

要在 DocBits 中找到此功能，请导航至 Settings → Document Types。在 Custom Document Types 下，点击 New。输入文档类型名称，可选地添加描述；如果文档包含表格，请勾选“Table available”。然后选择“Regex”而不是“Auto”，并点击“Next”。

<figure><img src="https://1870485400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlPczlNw8zzYNLfjfispX%2Fuploads%2Fgit-blob-9cfbd0133553b0318275e30f9eb2362202f1a7b8%2Fregex-manager-create-en-20261006.png?alt=media" alt="创建新文档类型页面，包含名称字段、“Table available”复选框、描述字段以及“Auto”和“Regex”按钮"><figcaption><p>选择“Regex”，以使用正则表达式对新的文档类型进行分类。</p></figcaption></figure>

## **添加和移除正则表达式**

“Regex”步骤会显示已有的正则表达式模型，每个模型都列出来源和模式，并提供用于创建新正则表达式模型的“Add”按钮。使用每行末尾的操作菜单来管理对应条目。点击“Next”继续配置“Fields & groups”。

<figure><img src="https://1870485400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlPczlNw8zzYNLfjfispX%2Fuploads%2Fgit-blob-7c0a1978efe08f27e0af199b5f61cf6e3707b971%2Fregex-manager-list-en-20261006.png?alt=media" alt="Regex 步骤，包含“Add”按钮以及一张列出三个正则表达式模型、来源、模式和操作的表格"><figcaption><p>已有的正则表达式模型及其来源和模式。点击“Add”可创建新模型。</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.docbits.com/chinese/guan-li-yu-she-zhi/setup/document-types/regex-manager.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
