> For the complete documentation index, see [llms.txt](https://cgps.gitbook.io/data-flo/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cgps.gitbook.io/data-flo/reference-guide/replace-values-in-list.md).

# replace-values-in-list

## Description

<mark style="color:purple;">`replace-values-in-list`</mark> *adaptor replaces specified values in a list using either text or regular expression*.

Use the [<mark style="color:purple;">`import-list-from-text-file`</mark>](/data-flo/reference-guide/import-list-from-text-file.md) adaptor to upload an existing text file, or connect to any other adaptor that outputs a list.

The text matching function is not case-sensitive, use the regular expression option if you need to specify case-sensitivity.

## Inputs

**`list`**\
Type: `list`\
Required: Yes\
The list of text values.

**`pattern`**\
Type: `text`\
Required: Yes\
The text or regular expression to be replaced. The pattern is treated as a regular expression if it begins and ends with `/` (e.g., `/.*/`).

**`replacement`**\
Type: `text`\
Required: No\
The text that replaces all instances of the `pattern`. If unspecified, matches will be replaced with blank text. If a regular expression was used as a pattern, capture groups can be included as `$1`, `$2`, etc.

## Outputs

**`list`**\
Type: `list`\
The list of modified elements

## Examples

### Example 1: Default behaviour.

Inputs:

`list`:

1. green
2. blue
3. red
4. yellow

`pattern`: yellow

`replacement`: brown

#### Outputs:

`list`:

1. green
2. blue
3. red
4. brown&#x20;

-> Replace the value `yellow` in the list with the new value `brown`.
