Class MaskingValidation
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
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
maskCharactercharThe masking character.
typeMaskingTypeThe masking type.
Returns
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
maskCharactercharThe character to check.
Returns
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
regularExpressionstringThe regular expression.
errorMessagestringThe reason why the expression is rejected, or null when it is valid.