Difference between revisions of "Regex class"

From Catglobe Wiki
Jump to: navigation, search
(Created page with "{{CGscriptClass_Template |Name=<nowiki>Regex</nowiki> |Description=<nowiki>A regexp engine</nowiki> |Constructors= {{CGscriptConstructors_Template|Parameters= {{CGscriptParameter...")
 
 
Line 2: Line 2:
 
|Name=<nowiki>Regex</nowiki>
 
|Name=<nowiki>Regex</nowiki>
 
|Description=<nowiki>A regexp engine</nowiki>
 
|Description=<nowiki>A regexp engine</nowiki>
|Constructors=
+
|InheritsFrom=object|Constructors=
 
{{CGscriptConstructors_Template|Parameters=
 
{{CGscriptConstructors_Template|Parameters=
{{CGscriptParameters_Template|Type=string|Name=<nowiki>exp</nowiki>|Description=<nowiki>Regular expression to use. See .NET documentation of what is possible for Regex class</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>matchAgainst</nowiki>|Description=<nowiki>String to match against</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>content</nowiki>|Description=<nowiki>True = Specifies single-line mode. Changes the meaning of the dot (.) so it matches every character (instead of every character except newline). False = Multiline mode. Changes the meaning of ^ and $ so they match at the beginning and end, respectively, of any line, and not just the beginning and end of the entire string.</nowiki>}}
+
{{CGscriptParameters_Template|Type=string|Name=<nowiki>exp</nowiki>|Description=<nowiki>Regular expression to use. See .NET documentation of what is possible for Regex class</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>matchAgainst</nowiki>|Description=<nowiki>String to match against</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=bool|Name=<nowiki>isSingleLine</nowiki>|Description=<nowiki>True = Specifies single-line mode. Changes the meaning of the dot (.) so it matches every character (instead of every character except newline). False = Multiline mode. Changes the meaning of ^ and $ so they match at the beginning and end, respectively, of any line, and not just the beginning and end of the entire string.</nowiki>}}
 
|Description=<nowiki>Match a string against a regular expression.</nowiki>}}
 
|Description=<nowiki>Match a string against a regular expression.</nowiki>}}
 
|Methods=
 
|Methods=
 
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>GetValue</nowiki>|Parameters=
 
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>GetValue</nowiki>|Parameters=
{{CGscriptParameters_Template|Type=number|Name=<nowiki>matchIndex</nowiki>|Description=<nowiki>Which match to give group count for</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>groupname</nowiki>|Description=<nowiki>Get by name if you used (?<name>)</nowiki>}}
+
{{CGscriptParameters_Template|Type=int|Name=<nowiki>matchIndex</nowiki>|Description=<nowiki>Which match to give group count for</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>groupname</nowiki>|Description=<nowiki>Get by name if you used (?<name>)</nowiki>}}
 
|Description=<nowiki>Get value for a given match</nowiki>}}
 
|Description=<nowiki>Get value for a given match</nowiki>}}
 
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>GetValue</nowiki>|Parameters=
 
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>GetValue</nowiki>|Parameters=
{{CGscriptParameters_Template|Type=number|Name=<nowiki>matchIndex</nowiki>|Description=<nowiki>Which match to give group count for</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=number|Name=<nowiki>groupname</nowiki>|Description=<nowiki>Get by index</nowiki>}}
+
{{CGscriptParameters_Template|Type=int|Name=<nowiki>matchIndex</nowiki>|Description=<nowiki>Which match to give group count for</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>groupname</nowiki>|Description=<nowiki>Get by index</nowiki>}}
 
|Description=<nowiki>Get value for a given match</nowiki>}}
 
|Description=<nowiki>Get value for a given match</nowiki>}}
{{CGscriptMethods_Template|ReturnType=number|Name=<nowiki>NumberOfGroups</nowiki>|Parameters=
+
{{CGscriptMethods_Template|ReturnType=int|Name=<nowiki>NumberOfGroups</nowiki>|Parameters=
{{CGscriptParameters_Template|Type=number|Name=<nowiki>matchIndex</nowiki>|Description=<nowiki>Which match to give group count for</nowiki>}}
+
{{CGscriptParameters_Template|Type=int|Name=<nowiki>matchIndex</nowiki>|Description=<nowiki>Which match to give group count for</nowiki>}}
 
|Description=<nowiki>Get number of groups for a given match</nowiki>}}
 
|Description=<nowiki>Get number of groups for a given match</nowiki>}}
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Description=<nowiki>The string representation of the object.</nowiki>}}
+
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Inherited=object|Description=<nowiki>The string representation of the object.</nowiki>}}
 
|Properties=
 
|Properties=
{{CGscriptProperties_Template|ReturnType=number|Name=<nowiki>NumberOfMatches</nowiki>|HasGetter=1|Description=<nowiki>Amount of matches</nowiki>}}
+
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>NumberOfMatches</nowiki>|HasGetter=1|Description=<nowiki>Amount of matches</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ObjectTypeName</nowiki>|HasGetter=1|Description=<nowiki>The name of the type of object.</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ObjectTypeName</nowiki>|HasGetter=1|Description=<nowiki>The name of the type of object.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Description=<nowiki>Get information about this class.</nowiki>}}
+
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Inherited=object|Description=<nowiki>Get information about this class.</nowiki>}}
 
}}
 
}}

Latest revision as of 09:45, 2 July 2020

Regex



A regexp engine

Parent class

Inherits from object

Constructors

  • (string exp "Regular expression to use. See .NET documentation of what is possible for Regex class", string matchAgainst "String to match against", bool isSingleLine "True = Specifies single-line mode. Changes the meaning of the dot (.) so it matches every character (instead of every character except newline). False = Multiline mode. Changes the meaning of ^ and $ so they match at the beginning and end, respectively, of any line, and not just the beginning and end of the entire string.") - Match a string against a regular expression.

Methods

  • string GetValue(int matchIndex "Which match to give group count for", string groupname "Get by name if you used (?<name>)") - Get value for a given match
  • string GetValue(int matchIndex "Which match to give group count for", int groupname "Get by index") - Get value for a given match
  • int NumberOfGroups(int matchIndex "Which match to give group count for") - Get number of groups for a given match
  • (From object) string ToString() - The string representation of the object.

Properties

  • int NumberOfMatches { get; } - Amount of matches
  • string ObjectTypeName { get; } - The name of the type of object.
  • (From object) TypeInformation TypeInformation { get; } - Get information about this class.