reckfellENGINE

RegExMatch

A retained match with captures and positions in the original subject.

On this page
class RegExMatchReckfellSharpInherits RefCounted

Obtain results through RegEx.Search or RegEx.SearchAll. Check for null first, then use GetString() for the whole match or GetString("name") for a group. Group 0 is the complete match; other numbers identify capturing parentheses.

GetStart/GetEnd refer to the original subject in native 32-bit units. After a non-BMP character these differ from C# UTF-16 indices. GetEnd is exclusive. Absent/nonparticipating groups have -1 positions; a participating empty group has equal nonnegative positions.

Strings is string[]; Names maps participating named groups to their numbers. Clearing the original RegEx does not erase an existing result.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

RegExMatchConstructor
# RegExMatch
C#
public RegExMatch();

Creates an empty container with no search result. Normally obtain RegExMatch through Search or SearchAll: construction performs no search.

Properties3

NamesProperty
# Names
C#
public Reckfell.Collections.Dictionary Names { get; }

Participating named groups and their numbers, as in GetNames. An unmatched optional group is omitted. Key order is not a substitute for capture numbers.

StringsProperty
# Strings
C#
public string[] Strings { get; }

Managed string[] containing the whole match and groups, as in GetStrings. Not Reckfell.Collections.Array. Empty text does not distinguish an empty capture from a nonparticipating group.

SubjectProperty
# Subject
C#
public string Subject { get; }

Entire original search subject, as in GetSubject; group positions refer to it.

Methods7

GetEndint
# GetEnd
C#
public int GetEnd(Variant? name = default);

Reads the group exclusive end in original Subject. Compute GetEnd - GetStart only after checking start >= 0. Units are native 32-bit units.

Parameters
NameTypeDefault
nameVariant?default
name

Group number or string name. Omitted/null selects group 0. Use valid nonnegative group numbers; -1 in a returned position means absent, not an input index.

Returns int

Position, or -1 if the group is absent/nonparticipating. A participating empty group has equal nonnegative start/end positions.

GetGroupCountint
# GetGroupCount
C#
public int GetGroupCount();

Returns capture-group count, excluding group 0. Includes groups that did not participate in this match.

Returns int

Capture count excluding the whole match; 0 in an empty container.

GetNamesReckfell.Collections.Dictionary
# GetNames
C#
public Reckfell.Collections.Dictionary GetNames();

Creates a name → group-number dictionary for participating named groups only. Mutating the returned dictionary does not reconfigure the stored result. Duplicate names select the first participating entry.

Returns Reckfell.Collections.Dictionary

New Dictionary mapping String names to integer group numbers.

GetStartint
# GetStart
C#
public int GetStart(Variant? name = default);

Reads group start in original Subject. Group 0 is the whole match. Position uses native 32-bit units, not C# UTF-16 indices or visible grapheme counts.

Parameters
NameTypeDefault
nameVariant?default
name

Group number or string name. Omitted/null selects group 0. Use valid nonnegative group numbers; -1 in a returned position means absent, not an input index.

Returns int

Position, or -1 if the group is absent/nonparticipating. A participating empty group has equal nonnegative start/end positions.

GetStringstring
# GetString
C#
public string GetString(Variant? name = default);

Returns selected group text using native positions correctly. Prefer it over C# Substring with GetStart/GetEnd unless indices were explicitly converted.

Parameters
NameTypeDefault
nameVariant?default
name

Group number or string name. Omitted/null selects group 0. Use valid nonnegative group numbers; -1 in a returned position means absent, not an input index.

Returns string

Group text or an empty string. Check GetStart to distinguish an empty capture from absence.

GetStringsstring[]
# GetStrings
C#
public string[] GetStrings();

Returns managed string[]: whole match at index 0, then numbered capture groups. Nonparticipating groups have empty strings.

Returns string[]

string[]; an empty container has no elements.

GetSubjectstring
# GetSubject
C#
public string GetSubject();

Returns the entire original search subject, not only matched text. The result retains it after Clear or recompiling the original RegEx.

Returns string

Original string value, not just the matched substring.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.