Table of Contents

Class MaskingValidation

Namespace
GroupeIsa.Neos.Shared.Masking
Assembly
GroupeIsa.Neos.Shared.dll

Validation of masking parameters, shared by the runtime, the generator and Neos Studio.

public static class MaskingValidation
Inheritance
MaskingValidation
Inherited Members

Fields

RegularExpressionOptions

The options used to compile a masking regular expression. The non-backtracking engine keeps the matching time proportional to the length of the value, whatever the expression.

public const RegexOptions RegularExpressionOptions = CultureInvariant | NonBacktracking

Field Value

RegexOptions

Methods

IsFormatSeparator(char, MaskingType)

Indicates whether a masking character is also a separator of a predefined format, such as the dash of a card number.

public static bool IsFormatSeparator(char maskCharacter, MaskingType type)

Parameters

maskCharacter char

The masking character.

type MaskingType

The masking type.

Returns

bool

true when the character is a separator of the format of the masking type.

Remarks

The masked values of the format could not be told apart from real values, which the write guard relies on. The separators are those that the maskers of the formats keep.

IsValidMaskCharacter(char)

Indicates whether a character can be used as masking character.

public static bool IsValidMaskCharacter(char maskCharacter)

Parameters

maskCharacter char

The character to check.

Returns

bool

true when the character is a punctuation mark or a symbol.

Remarks

Only punctuation marks and symbols are accepted, except the braille pattern blank. A letter or a number could not be told apart from a real value, and any other character (blank, control, format, combining mark, private use...) may be invisible.

TryValidateRegularExpression(string?, out string?)

Checks that a masking regular expression is present and accepted by the non-backtracking engine.

public static bool TryValidateRegularExpression(string? regularExpression, out string? errorMessage)

Parameters

regularExpression string

The regular expression.

errorMessage string

The reason why the expression is rejected, or null when it is valid.

Returns

bool

true when the expression is valid.