### Function

# GLib Regex escape_nul

since: 2.30

#### Declaration [src]

    gchar*
    g_regex_escape_nul (
      const gchar* string,
      gint length
    )

#### Description [src]

Escapes the nul characters in `string` to “\x00”. It can be used to compile a regex with embedded nul characters.

For completeness, `length` can be -1 for a nul-terminated string. In this case the output string will be of course equal to `string`.

Available since: 2.30

#### Parameters

`string`

  Type: `const gchar*`

  The string to escape.

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

`length`

  Type: `gint`

  The length of `string`.

#### Return value

Type: `gchar*`

A newly-allocated escaped string.

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