> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reelevant.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Replace with Variable

> Remplacer du texte en utilisant une valeur variable

## Présentation

La transformation `replace-var` remplace du texte dans une chaîne en utilisant une valeur variable comme remplacement.

## Syntaxe

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
replace-var(<variable>, <replace-variable>, search="", isRegex=false)
```

## Paramètres

| Paramètre          | Type     | Requis | Description                                                    |
| ------------------ | -------- | ------ | -------------------------------------------------------------- |
| `variable`         | string   | Oui    | La chaîne dans laquelle effectuer la recherche                 |
| `replace-variable` | variable | Oui    | La variable dont la valeur est utilisée comme remplacement     |
| `search`           | string   | Oui    | La sous-chaîne ou le motif regex à rechercher                  |
| `isRegex`          | boolean  | Oui    | Indique si la chaîne de recherche est une expression régulière |

## Exemples

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
replace-var(<variable>, <replace-variable>, search="placeholder", isRegex=false)
replace-var(<variable>, <replace-variable>, search="[0-9]+", isRegex=true)
```

<Info>
  Cette transformation est similaire à [Replace](/fr/advanced-guide/transformations/replace), mais utilise une variable pour la valeur de remplacement au lieu d'une chaîne statique.
</Info>
