Files
Picsur/shared/src/util/common-regex.ts

7 lines
485 B
TypeScript
Raw Normal View History

2022-04-16 17:09:01 +02:00
export const AlphaNumericRegex = /^[a-zA-Z0-9]+$/;
export const SHA256Regex = /^[a-f0-9A-F]{64}$/;
export const SemVerRegex = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/;
2022-04-16 16:35:28 +02:00
export const URLRegex =
/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[\-;:&=\+\$,\w]+@)?[A-Za-z0-9\.\-]+|(?:www\.|[\-;:&=\+\$,\w]+@)[A-Za-z0-9\.\-]+)((?:\/[\+~%\/\.\w\-_]*)?\??(?:[\-\+=&;%@\.\w_]*)#?(?:[\.\!\/\\\w]*))?)/;
2022-04-16 17:09:01 +02:00
export const UUIDRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;