Function

GLibRegexnew

Declaration

GRegex*
g_regex_new (
  const gchar* pattern,
  GRegexCompileFlags compile_options,
  GRegexMatchFlags match_options,
  GError** error
)

Description

Compiles the regular expression to an internal form, and does the initial setup of the GRegex structure.

Available since:2.14

Parameters

pattern

Type: const gchar*

The regular expression.

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

Type: GRegexCompileFlags

Compile options for the regular expression, or 0

match_options

Type: GRegexMatchFlags

Match options for the regular expression, or 0

error

Type: GError **

The return location for a GError*, or NULL.

Return value

Type: GRegex

A GRegex structure or NULL if an error occurred. Call g_regex_unref() when you are done with it.

The caller of the function takes ownership of the data, and is responsible for freeing it.
The return value can be NULL.