1using System.Text.RegularExpressions;
14 private readonly
bool useRegex;
28 this.useRegex =
false;
44 this.useRegex = UseRegex;
93 Options = RegexOptions.Singleline;
100 s = s.Substring(0, M.Index) + To + s.Substring(M.Index + M.Length);
117 RegexOptions Result = RegexOptions.Singleline;
119 if (!
string.IsNullOrEmpty(Options))
121 foreach (
char ch
in Options)
126 Result |= RegexOptions.IgnoreCase;
130 Result &= ~RegexOptions.Singleline;
131 Result |= RegexOptions.Multiline;
135 Result |= RegexOptions.IgnorePatternWhitespace;
Script runtime exception.
Class managing a script expression.
Replace(ScriptNode String, ScriptNode From, ScriptNode To, int Start, int Length, Expression Expression)
Replaceenates the elements of a vector, optionally delimiting the elements with a Delimiter.
static RegexOptions GetOptions(string Options, ScriptNode Node)
Converts a string-representation of regex options into an enumeration value.
override IElement Evaluate(IElement[] Arguments, Variables Variables)
Evaluates the function.
override string FunctionName
Name of the function
Replace(ScriptNode String, ScriptNode From, ScriptNode To, ScriptNode Options, int Start, int Length, Expression Expression)
Replaceenates the elements of a vector, optionally delimiting the elements with a Delimiter.
Replace(ScriptNode String, ScriptNode From, ScriptNode To, bool UseRegex, int Start, int Length, Expression Expression)
Replaceenates the elements of a vector, optionally delimiting the elements with a Delimiter.
override string[] DefaultArgumentNames
Default Argument names
Base class for multivariate funcions.
ScriptNode[] Arguments
Function arguments.
static readonly ArgumentType[] argumentTypes3Scalar
Three scalar parameters.
static readonly ArgumentType[] argumentTypes4Scalar
Four scalar parameters.
Base class for all nodes in a parsed script tree.
int Length
Length of expression covered by node.
override string ToString()
Expression Expression
Expression of which the node is a part.
int Start
Start position in script expression.
Basic interface for all types of elements.