# 文本提取 (Extraction in text)

要从文本块中提取特定值，请使用规则为 A(.*)\B 的正则表达式 (Regular Expression)。例如：您想从“验证码是 128293。请......”这样的消息中获取验证码，因此公式为“是(.*)。请”，返回给您的值是 128293。

<figure><img src="/files/YDmYHDEJuG2B04Q7uGAM" alt=""><figcaption></figcaption></figure>

<table><thead><tr><th width="258">参数</th><th>说明</th></tr></thead><tbody><tr><td>Data</td><td>选择包含一段文本的变量进行提取。</td></tr><tr><td>Extract rules</td><td>输入Regex表式以获取数据。</td></tr><tr><td>Index result</td><td>输入结果的索引，如果不输入节点将自动获取索引0。</td></tr><tr><td>Save to</td><td>将提取的值保存到变量中，该值将基于您选择的索引。</td></tr><tr><td>Test</td><td>单击时，您可以看到使用索引提取的结果。</td></tr></tbody></table>

例如，我们有这样一段数据：“我们有以下网站 <https://www.facebook.com/> 和其他网站，如 <https://www.youtube.com/> 和 <https://www.etsy>. com/”。当你想获取这段数据中包含的 URL 时，在 Extraction in text 节点中输入以下内容：

<figure><img src="/files/sByZJqiYSEhSRoYr9Fh4" alt=""><figcaption></figcaption></figure>

在 Index result 字段中输入数字 1，我们将得到 <https://www.facebook.com/> 并将其存储在 result 变量中。


---

# 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://docs.hidemium.io/zi-dong-hua-yong-hu-shou-ce/shu-ju-data/wen-ben-ti-qu-extraction-in-text.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.
