# regsub

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/regsub.c#L61
- **Page:** https://libtmux.org/en/tmux/latest/reference/c-function-regsub/

```c
char * regsub(const char *pattern, const char *with, const char *text, int flags)
```

## Parameters

- `pattern` (`const char *`)
- `with` (`const char *`)
- `text` (`const char *`)
- `flags` (`int`)

## Called by

- [`format_sub`](/en/tmux/latest/reference/c-function-format-c-format_sub/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/format.c#L4534)

## Calls

- [`regsub_copy`](/en/tmux/latest/reference/c-function-regsub-c-regsub_copy/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/regsub.c#L82)
- [`regsub_expand`](/en/tmux/latest/reference/c-function-regsub-c-regsub_expand/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/regsub.c#L100)
- [`xstrdup`](/en/tmux/latest/reference/c-function-xstrdup/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/regsub.c#L70)

## Referenced declarations

- [`nitems`](/en/tmux/latest/reference/c-define-tmux-h-nitems/) (constant)
