2024-01-26 21:41:32 +00:00
export const P_ALPHANUM = '[a-z0-9]' ;
export const P_ALPHANUM_DASH = '[a-z0-9-]' ;
export const P_HEX = '[0-9a-f]' ;
export const P_OCTET = '(?:25[0-5]|(?:2[0-4]|1[0-9]|[1-9]|)[0-9])' ;
2022-08-12 04:12:28 +00:00
2024-01-26 21:41:32 +00:00
export const P_IPV4 = ` (?: ${ P_OCTET } [.]){3} ${ P_OCTET } ` ;
export const P_UUID = ` ${ P_HEX } {8}-(?: ${ P_HEX } {4}-){3} ${ P_HEX } {12} ` ;
2022-08-12 04:12:28 +00:00
export const REP_DOMAIN = new RegExp (
2024-01-26 21:41:32 +00:00
` ^(?: ${ P_ALPHANUM } (?: ${ P_ALPHANUM_DASH } {0,61} ${ P_ALPHANUM } )?[.])+ ${ P_ALPHANUM } ${ P_ALPHANUM_DASH } {0,61} ${ P_ALPHANUM } $ ` ,
2022-08-12 04:12:28 +00:00
) ;
2024-01-26 21:41:32 +00:00
export const REP_IPV4 = new RegExp ( ` ^ ${ P_IPV4 } $ ` ) ;
2022-08-12 04:12:28 +00:00
2024-01-26 21:41:32 +00:00
export const REP_IPV4_CSV = new RegExp ( ` ^(?: ${ P_IPV4 } \\ s*, \\ s*)* ${ P_IPV4 } $ ` ) ;
2022-11-17 04:16:49 +00:00
// Peaceful string is temporarily defined as a string without single-quote, double-quote, slash (/), backslash (\\), angle brackets (< >), and curly brackets ({ }).
2022-11-22 18:38:05 +00:00
export const REP_PEACEFUL_STRING = /^[^'"/\\><}{]*$/ ;
2022-11-17 04:16:49 +00:00
2024-01-26 21:41:32 +00:00
export const REP_UUID = new RegExp ( ` ^ ${ P_UUID } $ ` , 'i' ) ;
2024-03-28 17:40:57 +00:00
// Try to only match password, not password script
export const REP_LABEL_PASSW = /(?=.*passw)(?!.*script).*/i ;