Difference between revisions of "RegexReplace class"

From Catglobe Wiki
Jump to: navigation, search
(Tag: visualeditor-switched)
 
Line 2: Line 2:
 
|Name=<nowiki>RegexReplace</nowiki>
 
|Name=<nowiki>RegexReplace</nowiki>
 
|Description=<nowiki>A regexp engine for replacing values</nowiki>
 
|Description=<nowiki>A regexp engine for replacing values</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=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>}}
 
{{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=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>}}
Line 13: Line 13:
 
{{CGscriptParameters_Template|Type=string|Name=<nowiki>input</nowiki>|Description=<nowiki>Input string to search</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=Function|Name=<nowiki>replacement</nowiki>|Description=<nowiki>Call this function once for every match, it must return the value to insert at the matched location. Gets each group as a seperate parameter. If using named captures, the names are mapped to parameter names.</nowiki>}}
 
{{CGscriptParameters_Template|Type=string|Name=<nowiki>input</nowiki>|Description=<nowiki>Input string to search</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=Function|Name=<nowiki>replacement</nowiki>|Description=<nowiki>Call this function once for every match, it must return the value to insert at the matched location. Gets each group as a seperate parameter. If using named captures, the names are mapped to parameter names.</nowiki>}}
 
|Description=<nowiki>Replace matches by return value from Function</nowiki>}}
 
|Description=<nowiki>Replace matches by return value from Function</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=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>}}
 
}}
 
}}
  
 
[[Category:Classes]]
 
[[Category:Classes]]

Latest revision as of 08:42, 2 July 2020

RegexReplace



A regexp engine for replacing values

Parent class

Inherits from object

Constructors

  • (string exp "Regular expression to use. See .NET documentation of what is possible for Regex class", 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.") - Create a new replacer.

Methods

  • string Replace(string input "Input string to search", string replacement "Replace all matches with this string") - Replace matches with given string
  • string Replace(string input "Input string to search", Function replacement "Call this function once for every match, it must return the value to insert at the matched location. Gets each group as a seperate parameter. If using named captures, the names are mapped to parameter names.") - Replace matches by return value from Function
  • (From object) string ToString() - The string representation of the object.

Properties

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