Table of Contents

Class ValidationConstants

Namespace
EchoHub.Core.Constants
Assembly
EchoHub.Core.dll
public static class ValidationConstants
Inheritance
ValidationConstants
Inherited Members

Fields

ChannelNamePattern

public const string ChannelNamePattern = "^[a-zA-Z0-9_-]{2,100}$"

Field Value

string

HexColorPattern

public const string HexColorPattern = "^#[0-9a-fA-F]{6}$"

Field Value

string

MaxBioLength

public const int MaxBioLength = 500

Field Value

int

MaxChannelTopicLength

public const int MaxChannelTopicLength = 500

Field Value

int

MaxDisplayNameLength

public const int MaxDisplayNameLength = 100

Field Value

int

MaxHistoryCount

public const int MaxHistoryCount = 100

Field Value

int

MaxPasswordLength

public const int MaxPasswordLength = 128

Field Value

int

MaxStatusMessageLength

public const int MaxStatusMessageLength = 100

Field Value

int

UsernamePattern

public const string UsernamePattern = "^[a-zA-Z0-9_-]{3,50}$"

Field Value

string

Methods

ChannelNameRegex()

[GeneratedRegex("^[a-zA-Z0-9_-]{2,100}$")]
public static Regex ChannelNameRegex()

Returns

Regex

Remarks

Pattern:

^[a-zA-Z0-9_-]{2,100}$

Explanation:

○ Match if at the beginning of the string.
○ Match a character in the set [\-0-9A-Z_a-z] atomically at least 2 and at most 100 times.
○ Match if at the end of the string or if before an ending newline.

HexColorRegex()

[GeneratedRegex("^#[0-9a-fA-F]{6}$")]
public static Regex HexColorRegex()

Returns

Regex

Remarks

Pattern:

^#[0-9a-fA-F]{6}$

Explanation:

○ Match if at the beginning of the string.
○ Match '#'.
○ Match a hexadecimal digit exactly 6 times.
○ Match if at the end of the string or if before an ending newline.

UsernameRegex()

[GeneratedRegex("^[a-zA-Z0-9_-]{3,50}$")]
public static Regex UsernameRegex()

Returns

Regex

Remarks

Pattern:

^[a-zA-Z0-9_-]{3,50}$

Explanation:

○ Match if at the beginning of the string.
○ Match a character in the set [\-0-9A-Z_a-z] atomically at least 3 and at most 50 times.
○ Match if at the end of the string or if before an ending newline.