Difference between revisions of "RegexReplace class"
CGHelpdesk (talk | contribs) (Created page with "PLEASE EDIT ME Category:Classes") |
|||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
− | + | {{CGscriptClass_Template | |
+ | |Name=<nowiki>RegexReplace</nowiki> | ||
+ | |Description=<nowiki>A regexp engine for replacing values</nowiki> | ||
+ | |InheritsFrom=object|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>|Inherited=object|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|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.