### Function

# Vte Regex new_for_match_full

since: 0.76

#### Declaration [src]

    VteRegex*
    vte_regex_new_for_match_full (
      const char* pattern,
      gssize pattern_length,
      uint32_t flags,
      uint32_t extra_flags,
      gsize* error_offset,
      GError** error
    )

#### Description [src]

Compiles `pattern` into a regex for use as a match regex with `vte_terminal_match_add_regex()` or vte_terminal_event_check_regex_simple().

See man:pcre2pattern(3) for information about the supported regex language, and man:pcre2api(3) for information about the supported `flags` and `extra_flags`.

The regex will be compiled using PCRE2_UTF and possibly other flags, in addition to the flags supplied in `flags`.

If regex compilation fails, `error` will be set and `error_offset` point to error as an offset into `pattern`.

Available since: 0.76

#### Parameters

`pattern`

  Type: `const char*`

  A regex pattern string.

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

`pattern_length`

  Type: `gssize`

  The length of `pattern` in bytes, or -1 if the string is NUL-terminated and the length is unknown.

`flags`

  Type: `uint32_t`

  PCRE2 compile flags.

`extra_flags`

  Type: `uint32_t`

  PCRE2 extra compile flags.

`error_offset`

  Type: `gsize*`

  Return location to store the error offset.

  The argument will be set by the function.
  The argument can be `NULL`.

`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 function 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: `VteRegex`

A newly created `VteRegex`, or `NULL`.

The caller of the function takes ownership of the data, and is responsible for freeing it.