# URL使用规则

以下是关于页面组、转化和事件设置中使用的规则，定义数据匹配条件的内容。

#### 包含 <a href="#bao-han" id="bao-han"></a>

针对包含特定字符串的URL进行定义。例如，将"abc.com"设置为"包含"时，以下类似的URL将被包含：

* `https://abc.com/lp`
* `https://abc.com/company`
* `https://abc.com/company/contact`

#### 不包含 <a href="#bu-bao-han" id="bu-bao-han"></a>

针对不包含特定字符串的URL进行定义。例如，如果希望除了博客页面之外的所有页面，可以将"example.com/blog"设置为"不包含"。

#### 头匹配 <a href="#tou-pi-pei" id="tou-pi-pei"></a>

将注册的字符串与头匹配的URL进行定义。通常在包含查询参数的URL中使用。

例如，假设特定访问者（id=9982251615）访问了以下URL：

`https://www.example.com/checkout.cgi?page=1&id=9982251615`

将上述URL设置为头匹配，则除了id=9982251615的用户访问外，其他用户的访问将不被影响。

如果想要针对所有用户进行影响，但同时只限制在page=1上，可以使用头匹配设定以下URL：

`https://www.example.com/checkout.cgi?page=1`

另外，如果想要包含除了page=1之外的页面，可以使用前向匹配注册以下URL：

`https://www.example.com/checkout.cgi?page`

#### 尾匹配 <a href="#wei-pi-pei" id="wei-pi-pei"></a>

将注册的字符串与尾匹配的URL进行定义。

例如，使用后向匹配注册"/test/index.html"，则诸如"<http://www.example.com/s/test/index.html>"这样的URL将被定义为目标。

但是，以下URL由于结尾不是"/test/index.html"，因此不会被影响：

`http://www.example.com/s/test/index.html?wore=xxx`

#### 完全匹配 <a href="#wan-quan-pi-pei" id="wan-quan-pi-pei"></a>

将设定的URL与实际URL完全一致的URL进行定义。

* Tips： 匹配参数：将页面的参数作为设定条件，只对携带特定参数的用户进行触达。 不匹配参数：无论进入页面的用户是否携带参数，都会进行触达。

#### 正则表达式 <a href="#zheng-ze-biao-da-shi" id="zheng-ze-biao-da-shi"></a>

正则表达式是用于表示一定格式的多个字符串的方法。

通过使用正则表达式，您可以进行更灵活的条件定义。

**常用正则表达式组合**

1. 头匹配网站域名并以斜线或问号结尾的URL

**正则表达式**： `^https:\/\/www.ptmind.com($|\/$|\/\?.*)`

**包含的URL**： `https://www.ptmind.comhttps://www.ptmind.com/https://www.ptmind.com/?WT.mc_id=xxxx`

**不包含的URL**： `https://www.ptmind.com/abc`

（以下省略，依此类推）

#### 正则表达式验证工具 <a href="#zheng-ze-biao-da-shi-yan-zheng-gong-ju" id="zheng-ze-biao-da-shi-yan-zheng-gong-ju"></a>

要确认正则表达式的书写是否正确，可以使用类似[正则检测工具](https://c.runoob.com/front-end/854/)进行检查。

※ 如果您在设置过程中有任何疑问，请随时通过微信Ptengien助手助手与我们联系。


---

# 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://helps.ptengine.com/cn/faq/insight-setting/url-rules.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.
