Table of Contents

Class RegexReplaceValue

Namespace
The.SQL.QIR.Values
Assembly
Instagile.dll

Replaces every match of the regular expression Pattern in Subject with Replacement. Produced by Regex.Replace(input, pattern, replacement) inside a query projection.

[MessagePackObject(false)]
public sealed class RegexReplaceValue : Value, IEquatable<Value>
Inheritance
RegexReplaceValue
Implements
Inherited Members

Remarks

As with RegexCondition, the regex grammar is backend-specific. Replacement substitution syntax is rewritten from .NET \(1</code>/<code>\)& to POSIX \1. Constant replacements are rewritten to the target dialect at translation time; when they refer to entity data (DynamicReplacement) the PostgreSQL and SQL Server backends instead rewrite it at runtime.

Constructors

RegexReplaceValue(Value, Value, Value, bool, bool)

public RegexReplaceValue(Value input, Value pattern, Value replacement, bool ignoreCase = false, bool dynamicReplacement = false)

Parameters

input Value
pattern Value
replacement Value
ignoreCase bool
dynamicReplacement bool

Fields

DynamicReplacement

Whether Replacement is a runtime value (not a constant) whose .NET substitution syntax still needs converting to the backend dialect at execution time.

[Key(4)]
public readonly bool DynamicReplacement

Field Value

bool

IgnoreCase

[Key(3)]
public readonly bool IgnoreCase

Field Value

bool

Pattern

[Key(1)]
public readonly Value Pattern

Field Value

Value

Replacement

[Key(2)]
public readonly Value Replacement

Field Value

Value

Subject

[Key(0)]
public readonly Value Subject

Field Value

Value

Properties

IsLiteral

Whether the value is self-paranthesing.

[IgnoreMember]
public override bool IsLiteral { get; }

Property Value

bool

IsNullable

Whether the value can be NULL at runtime.

[IgnoreMember]
public override bool IsNullable { get; }

Property Value

bool

Joins

Joins required to reach this value.

[IgnoreMember]
public override IEnumerable<Join> Joins { get; }

Property Value

IEnumerable<Join>

Methods

Equals(Value?)

Indicates whether the current object is equal to another object of the same type.

public override bool Equals(Value? obj)

Parameters

obj Value

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Update(Value, Value, Value, bool)

public RegexReplaceValue Update(Value input, Value pattern, Value replacement, bool ignoreCase)

Parameters

input Value
pattern Value
replacement Value
ignoreCase bool

Returns

RegexReplaceValue

WithSource(Table, Table)

public override Value WithSource(Table oldSource, Table newSource)

Parameters

oldSource Table
newSource Table

Returns

Value