Regex.checkReplacement

Checks whether replacement is a valid replacement string (see 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 glib.MatchInfo object.

class Regex
static
bool
checkReplacement
(,
out bool hasReferences
)

Parameters

replacement string

the replacement string

hasReferences bool

location to store information about references in replacement or NULL

Return Value

Type: bool

whether replacement is a valid replacement string

Throws

GException on failure.

Meta

Since

2.14