> For the complete documentation index, see [llms.txt](https://help.impact.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.impact.com/brand/it/what-would-you-like-to-learn-about/platform-features/promo-codes/regular-expression/regex-explained.md).

# Spiegazione delle regex

Regex (o Espressione Regolare) è un codice che puoi usare per confrontare testo in un caso generale ed è utile quando si confrontano codici promozionali. Regex è sensibile alle maiuscole/minuscole, quindi assicurati di impostare la tua regex in modo che corrisponda ai tuoi codici promozionali.

* Esistono due casi logici principali per regex e codici promozionali—`inizia con` e `termina con`.
* Per questo esempio, la base del nostro codice promozionale è `SUMMER`.

{% tabs %}
{% tab title="Inizia con" %}
Hai emesso una serie di codici promozionali estivi ai partner, `SUMMER20OFF`, `SUMMER10`, e `SUMMER25`. Vogliamo abbinarli tutti per accreditare i nostri partner, come facciamo? Useremmo la `inizia con` logica. Basta aggiungere un punto e un asterisco alla fine del codice promozionale di base.

La regex dovrebbe essere esattamente `^(SUMMER).*`

Questo corrisponderà automaticamente a qualsiasi codice promozionale che inizi con `SUMMER` e termini con qualsiasi altro carattere. Qualsiasi codice che non inizi con `SUMMER` non verrà abbinato.
{% endtab %}

{% tab title="Termina con" %}
Hai emesso una serie di codici promozionali estivi ai partner, `20OFFSUMMER`, `10SUMMER`, e `25SUMMER` in cui il codice promozionale termina sempre con `SUMMER`. Come li abbiniamo? Useremmo la `termina con` logica. Basta aggiungere un punto e un asterisco all'inizio del codice promozionale di base e aggiungere un $ per specificare l'ancoraggio della stringa.

La regex dovrebbe essere esattamente `^.*(SUMMER)$`

Questo corrisponderà automaticamente a qualsiasi codice promozionale che inizi con altri caratteri e termini con `SUMMER`. Qualsiasi codice che non termini con `SUMMER` non verrà abbinato.
{% endtab %}
{% endtabs %}

Per espressioni più complesse, contatta il tuo CSM oppure [contatta l'assistenza](https://app.impact.com/support/portal.ihtml?createTicket=true\&accountType=ADVERTISER) per assistenza.

{% hint style="info" %}
**Nota:** Puoi rimuovere la sensibilità alle maiuscole/minuscole della regex aggiungendo `(?i)` dopo `^` nella tua regex.
{% endhint %}

#### Esempio

```programlisting
^(?i)(SUMMER).*
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.impact.com/brand/it/what-would-you-like-to-learn-about/platform-features/promo-codes/regular-expression/regex-explained.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
