Class Regex
- Namespace
- GLib
- Assembly
- GLib-2.0.dll
public sealed class Regex : BoxedRecord, GTypeProvider, InstanceFactory, IEquatable<Regex>, IDisposable
- Inheritance
-
Regex
- Implements
- Inherited Members
Constructors
Regex(RegexOwnedHandle)
public Regex(RegexOwnedHandle handle)
Parameters
handleRegexOwnedHandle
Properties
Handle
public RegexOwnedHandle Handle { get; }
Property Value
Methods
CheckReplacement(string, out bool)
[Version("2.14")]
public static bool CheckReplacement(string replacement, out bool hasReferences)
Parameters
Returns
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Equals(Regex?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(Regex? other)
Parameters
otherRegexAn object to compare with this object.
Returns
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current object.
Returns
ErrorQuark()
public static Quark ErrorQuark()
Returns
EscapeNul(string, int)
[Version("2.30")]
public static string EscapeNul(string @string, int length)
Parameters
Returns
EscapeString(string, int)
[Version("2.14")]
public static string EscapeString(string @string, int length)
Parameters
Returns
GetCaptureCount()
[Version("2.14")]
public int GetCaptureCount()
Returns
GetCompileFlags()
[Version("2.26")]
public RegexCompileFlags GetCompileFlags()
Returns
GetGType()
public static Type GetGType()
Returns
GetHasCrOrLf()
[Version("2.34")]
public bool GetHasCrOrLf()
Returns
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
GetMaxBackref()
[Version("2.14")]
public int GetMaxBackref()
Returns
GetMaxLookbehind()
[Version("2.38")]
public int GetMaxLookbehind()
Returns
GetPattern()
[Version("2.14")]
public string GetPattern()
Returns
GetStringNumber(string)
[Version("2.14")]
public int GetStringNumber(string name)
Parameters
namestring
Returns
MatchSimple(string, string, RegexCompileFlags, RegexMatchFlags)
[Version("2.14")]
public static bool MatchSimple(string pattern, string @string, RegexCompileFlags compileOptions, RegexMatchFlags matchOptions)
Parameters
patternstringstringstringcompileOptionsRegexCompileFlagsmatchOptionsRegexMatchFlags
Returns
New(string, RegexCompileFlags, RegexMatchFlags)
[Version("2.14")]
public static Regex? New(string pattern, RegexCompileFlags compileOptions, RegexMatchFlags matchOptions)
Parameters
patternstringcompileOptionsRegexCompileFlagsmatchOptionsRegexMatchFlags
Returns
Ref()
[Version("2.14")]
public Regex Ref()
Returns
Replace(string[], nint, int, string, RegexMatchFlags)
[Version("2.14")]
public string Replace(string[] @string, nint stringLen, int startPosition, string replacement, RegexMatchFlags matchOptions)
Parameters
stringstring[]stringLennintstartPositionintreplacementstringmatchOptionsRegexMatchFlags
Returns
ReplaceEval(string[], nint, int, RegexMatchFlags, RegexEvalCallback)
[Version("2.14")]
public string ReplaceEval(string[] @string, nint stringLen, int startPosition, RegexMatchFlags matchOptions, RegexEvalCallback eval)
Parameters
stringstring[]stringLennintstartPositionintmatchOptionsRegexMatchFlagsevalRegexEvalCallback
Returns
ReplaceLiteral(string[], nint, int, string, RegexMatchFlags)
[Version("2.14")]
public string ReplaceLiteral(string[] @string, nint stringLen, int startPosition, string replacement, RegexMatchFlags matchOptions)
Parameters
stringstring[]stringLennintstartPositionintreplacementstringmatchOptionsRegexMatchFlags
Returns
Split(string, RegexMatchFlags)
[Version("2.14")]
public string[] Split(string @string, RegexMatchFlags matchOptions)
Parameters
stringstringmatchOptionsRegexMatchFlags
Returns
- string[]
SplitFull(string[], nint, int, RegexMatchFlags, int)
[Version("2.14")]
public string[] SplitFull(string[] @string, nint stringLen, int startPosition, RegexMatchFlags matchOptions, int maxTokens)
Parameters
stringstring[]stringLennintstartPositionintmatchOptionsRegexMatchFlagsmaxTokensint
Returns
- string[]
SplitSimple(string, string, RegexCompileFlags, RegexMatchFlags)
[Version("2.14")]
public static string[] SplitSimple(string pattern, string @string, RegexCompileFlags compileOptions, RegexMatchFlags matchOptions)
Parameters
patternstringstringstringcompileOptionsRegexCompileFlagsmatchOptionsRegexMatchFlags
Returns
- string[]
Unref()
[Version("2.14")]
public void Unref()