Vte.Regex.substitute

### Method

# Vte Regexsubstitute

since: 0.56

#### Declaration [src]

    char*
    vte_regex_substitute (
      VteRegex* regex,
      const char* subject,
      const char* replacement,
      guint32 flags,
      GError** error
    )

#### Description [src]

See man:pcre2api(3) and man:pcre2_substitute(3) for more information.

Available since: 0.56

#### Parameters

`subject`

  Type: `const char*`

  The subject string.

  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

`replacement`

  Type: `const char*`

  The replacement string.

  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

`flags`

  Type: `guint32`

  PCRE2 match flags.

`error`

  Type: `GError **`

  The return location for a recoverable error.

  The argument can be `NULL`.
  If the return location is not `NULL`, then you must initialize it to a `NULL` `GError*`.
  The argument will be left initialized to `NULL` by the method if there are no errors.
  In case of error, the argument will be set to a newly allocated `GError`; the caller will take ownership of the data, and be responsible for freeing it.

#### Return value

Type: `char*`

The substituted string, or `NULL` if an error occurred.

The caller of the method takes ownership of the data, and is responsible for freeing it.
The value is a NUL terminated UTF-8 string.