Table of Contents

Class Regex

Namespace
GLib
Assembly
GLib-2.0.dll
public sealed class Regex : BoxedRecord, IEquatable<Regex>
Inheritance
Regex
Implements
Inherited Members

Constructors

Regex(RegexOwnedHandle)

public Regex(RegexOwnedHandle handle)

Parameters

handle RegexOwnedHandle

Properties

Handle

public RegexOwnedHandle Handle { get; }

Property Value

RegexOwnedHandle

Methods

CheckReplacement(string, out bool)

[Version("2.14")]
public static bool CheckReplacement(string replacement, out bool hasReferences)

Parameters

replacement string
hasReferences bool

Returns

bool

Equals(Regex?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(Regex? other)

Parameters

other Regex

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

ErrorQuark()

public static Quark ErrorQuark()

Returns

Quark

EscapeNul(string, int)

[Version("2.30")]
public static string EscapeNul(string @string, int length)

Parameters

string string
length int

Returns

string

EscapeString(string, int)

[Version("2.14")]
public static string EscapeString(string @string, int length)

Parameters

string string
length int

Returns

string

GetCaptureCount()

[Version("2.14")]
public int GetCaptureCount()

Returns

int

GetCompileFlags()

[Version("2.26")]
public RegexCompileFlags GetCompileFlags()

Returns

RegexCompileFlags

GetGType()

public static Type GetGType()

Returns

Type

GetHasCrOrLf()

[Version("2.34")]
public bool GetHasCrOrLf()

Returns

bool

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

GetMatchFlags()

[Version("2.26")]
public RegexMatchFlags GetMatchFlags()

Returns

RegexMatchFlags

GetMaxBackref()

[Version("2.14")]
public int GetMaxBackref()

Returns

int

GetMaxLookbehind()

[Version("2.38")]
public int GetMaxLookbehind()

Returns

int

GetPattern()

[Version("2.14")]
public string GetPattern()

Returns

string

GetStringNumber(string)

[Version("2.14")]
public int GetStringNumber(string name)

Parameters

name string

Returns

int

MatchSimple(string, string, RegexCompileFlags, RegexMatchFlags)

[Version("2.14")]
public static bool MatchSimple(string pattern, string @string, RegexCompileFlags compileOptions, RegexMatchFlags matchOptions)

Parameters

pattern string
string string
compileOptions RegexCompileFlags
matchOptions RegexMatchFlags

Returns

bool

New(string, RegexCompileFlags, RegexMatchFlags)

[Version("2.14")]
public static Regex? New(string pattern, RegexCompileFlags compileOptions, RegexMatchFlags matchOptions)

Parameters

pattern string
compileOptions RegexCompileFlags
matchOptions RegexMatchFlags

Returns

Regex

Ref()

[Version("2.14")]
public Regex Ref()

Returns

Regex

Replace(string[], long, int, string, RegexMatchFlags)

[Version("2.14")]
public string Replace(string[] @string, long stringLen, int startPosition, string replacement, RegexMatchFlags matchOptions)

Parameters

string string[]
stringLen long
startPosition int
replacement string
matchOptions RegexMatchFlags

Returns

string

ReplaceEval(string[], long, int, RegexMatchFlags, RegexEvalCallback)

[Version("2.14")]
public string ReplaceEval(string[] @string, long stringLen, int startPosition, RegexMatchFlags matchOptions, RegexEvalCallback eval)

Parameters

string string[]
stringLen long
startPosition int
matchOptions RegexMatchFlags
eval RegexEvalCallback

Returns

string

ReplaceLiteral(string[], long, int, string, RegexMatchFlags)

[Version("2.14")]
public string ReplaceLiteral(string[] @string, long stringLen, int startPosition, string replacement, RegexMatchFlags matchOptions)

Parameters

string string[]
stringLen long
startPosition int
replacement string
matchOptions RegexMatchFlags

Returns

string

Split(string, RegexMatchFlags)

[Version("2.14")]
public string[] Split(string @string, RegexMatchFlags matchOptions)

Parameters

string string
matchOptions RegexMatchFlags

Returns

string[]

SplitFull(string[], long, int, RegexMatchFlags, int)

[Version("2.14")]
public string[] SplitFull(string[] @string, long stringLen, int startPosition, RegexMatchFlags matchOptions, int maxTokens)

Parameters

string string[]
stringLen long
startPosition int
matchOptions RegexMatchFlags
maxTokens int

Returns

string[]

SplitSimple(string, string, RegexCompileFlags, RegexMatchFlags)

[Version("2.14")]
public static string[] SplitSimple(string pattern, string @string, RegexCompileFlags compileOptions, RegexMatchFlags matchOptions)

Parameters

pattern string
string string
compileOptions RegexCompileFlags
matchOptions RegexMatchFlags

Returns

string[]

Unref()

[Version("2.14")]
public void Unref()