-
Notifications
You must be signed in to change notification settings - Fork 0
API Host ScriptRegex
对 System.Text.RegularExpressions.Regex 的脚本正则表达式包装类型。
Script regular expression wrapper over System.Text.RegularExpressions.Regex.
命名空间:AuroraScript.Runtime.Types。类型:class。
Namespace:
AuroraScript.Runtime.Types. Kind: class.
Purpose
ScriptRegex 是公开宿主类型。通过下方签名选择调用方式;对运行时对象、生命周期和异常,应由宿主在边界处明确处理。
Script regular expression wrapper over System.Text.RegularExpressions.Regex.
Simple Example
下面是 ScriptRegex 的最小使用方式。
A minimal use of
ScriptRegex.
var regex = new ScriptRegex(
new Regex("^\\d+$"),
"");
var matched = regex.Test(ScriptDatum.FromString("42"));
Console.WriteLine(matched); // TrueMembers
创建 ScriptRegex 实例。
Use the member according to its public signature.
Parameters:
-
regex
按签名提供的Regex参数。The
Regexparameter required by the signature. -
flags
要应用的标志集合。Set of flags to apply.
Returns
新建的 ScriptRegex 实例。
A new
ScriptRegexinstance.
调用示意
以下示例展示调用形状;将占位实例和参数替换为宿主中的实际值。
The example shows the call shape; replace placeholder instances and arguments with actual host values.
var value = new ScriptRegex(/* 参数 */);调用 Test 完成其公开操作。
Use the member according to its public signature.
Parameters:
-
value
要处理、保存或转换的值。Value to process, store, or convert.
Returns
返回 bool。
Returns
bool.
调用示意
以下示例展示调用形状;将占位实例和参数替换为宿主中的实际值。
The example shows the call shape; replace placeholder instances and arguments with actual host values.
ScriptRegex value = /* 从宿主 API 获取实例 */;
var result = value.Test(/* value */);调用 Match 完成其公开操作。
Use the member according to its public signature.
Parameters:
-
str
按签名提供的StringValue参数。The
StringValueparameter required by the signature.
Returns
返回 ScriptObject。
Returns
ScriptObject.
调用示意
以下示例展示调用形状;将占位实例和参数替换为宿主中的实际值。
The example shows the call shape; replace placeholder instances and arguments with actual host values.
ScriptRegex value = /* 从宿主 API 获取实例 */;
var result = value.Match(/* str */);调用 MatchOfGlobal 完成其公开操作。
Use the member according to its public signature.
Parameters:
-
str
按签名提供的StringValue参数。The
StringValueparameter required by the signature.
Returns
返回 ScriptObject。
Returns
ScriptObject.
调用示意
以下示例展示调用形状;将占位实例和参数替换为宿主中的实际值。
The example shows the call shape; replace placeholder instances and arguments with actual host values.
ScriptRegex value = /* 从宿主 API 获取实例 */;
var result = value.MatchOfGlobal(/* str */);调用 MatchAll 完成其公开操作。
Use the member according to its public signature.
Parameters:
-
str
按签名提供的StringValue参数。The
StringValueparameter required by the signature.
Returns
返回 ScriptArray。
Returns
ScriptArray.
调用示意
以下示例展示调用形状;将占位实例和参数替换为宿主中的实际值。
The example shows the call shape; replace placeholder instances and arguments with actual host values.
ScriptRegex value = /* 从宿主 API 获取实例 */;
var result = value.MatchAll(/* str */);调用 HasFlag 完成其公开操作。
Use the member according to its public signature.
Parameters:
-
flag
要检查或应用的标志。Flag to inspect or apply.
Returns
返回 bool。
Returns
bool.
调用示意
以下示例展示调用形状;将占位实例和参数替换为宿主中的实际值。
The example shows the call shape; replace placeholder instances and arguments with actual host values.
ScriptRegex value = /* 从宿主 API 获取实例 */;
var result = value.HasFlag(/* flag */);AuroraScript.JIT 4.0.0 · Documentation Home · Repository · MIT License