Difference between revisions of "RegexReplace class"

From Catglobe Wiki
Jump to: navigation, search
(Created page with "PLEASE EDIT ME Category:Classes")
 
(Tag: visualeditor-switched)
Line 1: Line 1:
PLEASE EDIT ME
+
{{CGscriptClass_Template
 +
|Name=<nowiki>RegexReplace</nowiki>
 +
|Description=<nowiki>A regexp engine for replacing values</nowiki>
 +
|Constructors=
 +
{{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>}}
 +
|Description=<nowiki>Create a new replacer.</nowiki>}}
 +
|Methods=
 +
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>Replace</nowiki>|Parameters=
 +
{{CGscriptParameters_Template|Type=string|Name=<nowiki>input</nowiki>|Description=<nowiki>Input string to search</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=string|Name=<nowiki>replacement</nowiki>|Description=<nowiki>Replace all matches with this string</nowiki>}}
 +
|Description=<nowiki>Replace matches with given string</nowiki>}}
 +
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>Replace</nowiki>|Parameters=
 +
{{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>}}
 +
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Description=<nowiki>The string representation of the object.</nowiki>}}
 +
|Properties=
 +
{{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>}}
 +
}}
 +
 
 
[[Category:Classes]]
 
[[Category:Classes]]

Revision as of 20:43, 22 December 2017

RegexReplace



A regexp engine for replacing values

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
  • string ToString() - The string representation of the object.

Properties

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