Skip to content

API Host ScriptRegex

Liu.Yandong.Hanks edited this page Aug 21, 2026 · 3 revisions

ScriptRegex

Script regular expression wrapper over System.Text.RegularExpressions.Regex.

Namespace: AuroraScript.Runtime.Types. Kind: class.

Back to .NET Host API Reference

Overview

Script regular expression wrapper over System.Text.RegularExpressions.Regex.

Quick Reference

A minimal use of ScriptRegex.

var regex = new ScriptRegex(
    new Regex("^\\d+$"),
    "");

var matched = regex.Test(ScriptDatum.FromString("42"));
Console.WriteLine(matched); // True

Constructors

ScriptRegex(Regex regex, string flags)

Creates a ScriptRegex instance.

ScriptRegex(Regex regex, string flags)

Parameters

Name Type Required Description
regex Regex Yes CLR regular expression to wrap.
flags string Yes Regular-expression flags.

Returns

A new ScriptRegex instance.

Methods

Test

bool Test(ScriptDatum value)

Parameters

Name Type Required Description
value ScriptDatum Yes Script value converted to text and tested against the regular expression.

Returns

Returns bool.

Match

ScriptObject Match(StringValue str)

Parameters

Name Type Required Description
str StringValue Yes The StringValue parameter required by the signature.

Returns

Returns ScriptObject.

MatchOfGlobal

ScriptObject MatchOfGlobal(StringValue str)

Parameters

Name Type Required Description
str StringValue Yes The StringValue parameter required by the signature.

Returns

Returns ScriptObject.

MatchAll

ScriptArray MatchAll(StringValue str)

Parameters

Name Type Required Description
str StringValue Yes The StringValue parameter required by the signature.

Returns

Returns ScriptArray.

HasFlag

bool HasFlag(string flag)

Parameters

Name Type Required Description
flag string Yes Flag to inspect or apply.

Returns

Returns bool.

Clone this wiki locally