# Pattern Matching Syntax

Within the Link11 WAAP interface, there are several features that require matching conditions to be specified.&#x20;

The text boxes accept strings or PCRE (Perl Compatible Regular Expressions). If you are unsure of PCRE syntax, you can test your expression at sites such as <https://regex101.com>, which will show you how it will be parsed.&#x20;

Below are some examples of syntax for specifying matching patterns.

| Functionality                                      | Syntax              | Remarks                                                                                                        |
| -------------------------------------------------- | ------------------- | -------------------------------------------------------------------------------------------------------------- |
| Match **/Images/** or **/images/** or **/IMAGES/** | `~* /images/`       | Case insensitive, regular expression matching.                                                                 |
| Match URLs that ends with **.DOC** or **.PDF**     | `~ \.(DOC\|PDF)$`   | Case *sensitive*, regular expression matching.                                                                 |
| Match URLs that ends with **.gif** or **.jpg**     | `~* \.(gif\|jpg)$`  | Case *insensitive*, regular expression matching.                                                               |
| Match *exact* URL, e.g. Root **/** or **/admin**   | `= /` or `= /admin` | Searching stops immediately (this match is top priority).                                                      |
| Match all URLs starting with **/documents/**       | `/documents/`       | System will continue search for a regular expression match. This will be matched only if none will be found.   |
| Prioritize URLs starting with **/documents/**      | `^~ /documents/`    | **^\~** means - match and halt searching, i.e. regular expressions will not be checked.                        |
| Match 'entire site' (anything else)                | `/`                 | Matches any URL since all begins with "/". However, regular expressions and longer entries will take priority. |

A common pattern is for matching all static content. This pattern in full is:

```
~* \.(gcur|htc|aif|aiff|au|avi|bin|bmp|cab|cct|cdf|class|doc|dcr|dtd|exe|flv|gcf|gff|gif|grv|hdml|hqx|ico|ini|jpeg|jpg|js|mov|mp3|nc|pct|pdf|png|ppc|pws|swa|swf|txt|vbs|w32|wav|wbmp|wml|wmlc|wmls|xsd|zip|webp|jxr|hdp|wdp|bz2|map|ttf|ttc|otf|eot|woff|css)$
```


---

# 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://waap.docs.link11.com/reference-information/pattern-samples.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.
