Valadoc | Vala | Tutorial | API-References | Markup

check_replacement


Description:

public static bool check_replacement (out bool has_references = null) throws RegexError

Checks whether replacement is a valid replacement string (see g_regex_replace()), i.e. that all escape sequences in it are valid.

If has_references is not NULL then replacement is checked for pattern references. For instance, replacement text 'foo\n' does not contain references and may be evaluated without information about actual match, but '\0\1' (whole match followed by first subpattern) requires valid GMatchInfo object.

Parameters:

replacement the replacement string
has_references location to store information about references in replacement or NULL. [out][allow-none]
error location to store error

Returns:

whether replacement is a valid replacement string