Table of Contents

Class StdRegex

Namespace
TabScript.StandardLibraries
Assembly
TableScript.dll

Standard regex library. Basic regex functionality

public static class StdRegex
Inheritance
StdRegex
Inherited Members

Properties

AllFunctions

public static (Delegate func, string description)[] AllFunctions { get; }

Property Value

(Delegate func, string description)[]

AsImport

public static ResolvedImport AsImport { get; }

Property Value

ResolvedImport

Methods

allMatch(Table, string)

True if all elements of the table match the regex

public static bool allMatch(Table self, string regex)

Parameters

self Table
regex string

Returns

bool

anyMatch(Table, string)

True if any element of the table matches the regex

public static bool anyMatch(Table self, string regex)

Parameters

self Table
regex string

Returns

bool

countMatches(Table, string)

Number of matches in all elements

public static int countMatches(Table self, string regex)

Parameters

self Table
regex string

Returns

int

escape(string)

Escapes regex syntax to be a literal

public static string escape(string regex)

Parameters

regex string

Returns

string

firstMatch(Table, string)

Returns the first match found in any of the elements(in order)

public static Table firstMatch(Table self, string regex)

Parameters

self Table
regex string

Returns

Table

firstMatchGroups(Table, string)

Returns a table with the first match found in any of the elements(in order) followed by its capture groups

public static Table firstMatchGroups(Table self, string regex)

Parameters

self Table
regex string

Returns

Table

indexOfMatch(string, string)

Find index of first match of a string(NOT table). -1 for no match

public static int indexOfMatch(string self, string regex)

Parameters

self string
regex string

Returns

int

match(string, string)

Returns a table with all matches of a string (NOT table)

public static Table match(string self, string regex)

Parameters

self string
regex string

Returns

Table

matchGroups(string, string)

Returns a stdlist list with all matches of a string (NOT table). Each match is a table inside the list, having the match found followed by its capture groups

public static Table matchGroups(string self, string regex)

Parameters

self string
regex string

Returns

Table

replaceMatches(Table, string, string)

Replace all matches by their replacement in all elements

public static Table replaceMatches(Table self, string regex, string replacement)

Parameters

self Table
regex string
replacement string

Returns

Table

split(Table, string)

Split all elements by a regex separator

public static Table split(Table self, string regex)

Parameters

self Table
regex string

Returns

Table