VteRegex

VteRegex — Regex for matching and searching. Uses PCRE2 internally.

Types and Values

Object Hierarchy

    GBoxed
    ╰── VteRegex

Description

Functions

vte_regex_ref ()

VteRegex *
vte_regex_ref (VteRegex *regex);

Decreases the reference count of regex by one, and frees regex if the refcount reaches zero.

Parameters

regex

a VteRegex.

[transfer full]

Returns

NULL


vte_regex_unref ()

VteRegex *
vte_regex_unref (VteRegex *regex);

vte_regex_new_for_match ()

VteRegex *
vte_regex_new_for_match (const char *pattern,
                         gssize pattern_length,
                         guint32 flags,
                         GError **error);

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.

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

Parameters

pattern

a regex pattern string

 

pattern_length

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

 

flags

PCRE2 compile flags

 

error

return location for a GError, or NULL.

[allow-none]

Returns

a newly created VteRegex, or NULL with error filled in.

[transfer full]


vte_regex_new_for_search ()

VteRegex *
vte_regex_new_for_search (const char *pattern,
                          gssize pattern_length,
                          guint32 flags,
                          GError **error);

Compiles pattern into a regex for use as a search regex with vte_terminal_search_set_regex().

See man:pcre2pattern(3) for information about the supported regex language.

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

Parameters

pattern

a regex pattern string

 

pattern_length

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

 

flags

PCRE2 compile flags

 

error

return location for a GError, or NULL.

[allow-none]

Returns

a newly created VteRegex, or NULL with error filled in.

[transfer full]


vte_regex_jit ()

gboolean
vte_regex_jit (VteRegex *regex,
               guint32 flags,
               GError **error);

If the platform supports JITing, JIT compiles regex .

Parameters

regex

a VteRegex

 

Returns

TRUE if JITing succeeded, or FALSE with error filled in

Types and Values

VteRegex

typedef struct _VteRegex VteRegex;