# Wildcards

## What are wildcards

Wildcards, or else you might call it [Regex](https://en.wikipedia.org/wiki/Regular_expression), are a way to define not only a direct text to be matched in Public reply, but also a pattern. This can save you from having to define big list of rules manually, and instead tell Ticket Guardian about a pattern of text that you wish to be found.

Imagine your organisation have placeholders in a single public response template. We only need a pattern to be able to catch those placeholders and have a piece of mind when sending our response. For example:

```
Hello ACME_USERNAME,
We understand that you have concerns about ACME_PRODUCT.
In order to get this resolved and have ACME_PRODUCT delivered to you by ACME_DATE,
please, provide us with:
- ACME_LIST_OF_DOCUMENTS

Thank you,
ACME_AGENT
```

First thing that you might want to do is to define all those placeholders in Ticket Guardian separarely. But we can see a pattern - there is "ACME\_" prefix in front of all of them.

This means you can create only **one rule&#x20;**~~**(**&#x74;o rule them all)~~ `ACME_*` .

This a *Regex pattern*, and what is important here, is that your pattern will match all text that has **ACME\_** as prefix, where `*` means find **any character.**

## Recipes

1. Match all after text `foo` something:\
   `foo*`
2. Match all before text `foo`\
   `*foo`
3. Match only `foo_one` and `foo_two` but not `foo_three` or anything else:\
   `foo_(one|two)`

More examples will follow.

### Regular expressions

If you are feeling adventures and would like to try writing more advanced / different wildcards (which are regular expressions under the hood), here is a good starting point: [MDN Regular expressions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions).


---

# 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://pineapps.gitbook.io/ticket-guardian/wildcards.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.
