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
Methods
allMatch(Table, string)
True if all elements of the table match the regex
public static bool allMatch(Table self, string regex)
Parameters
Returns
anyMatch(Table, string)
True if any element of the table matches the regex
public static bool anyMatch(Table self, string regex)
Parameters
Returns
countMatches(Table, string)
Number of matches in all elements
public static int countMatches(Table self, string regex)
Parameters
Returns
escape(string)
Escapes regex syntax to be a literal
public static string escape(string regex)
Parameters
regexstring
Returns
firstMatch(Table, string)
Returns the first match found in any of the elements(in order)
public static Table firstMatch(Table self, string regex)
Parameters
Returns
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
Returns
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
Returns
match(string, string)
Returns a table with all matches of a string (NOT table)
public static Table match(string self, string regex)
Parameters
Returns
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
Returns
replaceMatches(Table, string, string)
Replace all matches by their replacement in all elements
public static Table replaceMatches(Table self, string regex, string replacement)
Parameters
Returns
split(Table, string)
Split all elements by a regex separator
public static Table split(Table self, string regex)