mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-08 08:53:51 +00:00
686c6108bf
--------- Co-authored-by: Joel Wetzell <jwetzell@yahoo.com> Co-authored-by: arc-alex <ac@omnivox.dk>
14 lines
523 B
TypeScript
14 lines
523 B
TypeScript
/**
|
|
* Simple regex patterns for common use cases
|
|
* mostly used in form validation
|
|
*/
|
|
|
|
export const isOnlyNumbers = /^\d+$/;
|
|
export const isIPAddress = /^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}$/;
|
|
export const startsWithHttp = /^http:\/\//;
|
|
export const startsWithSlash = /^\//;
|
|
export const isAlphanumeric = /^[a-z0-9]+$/i;
|
|
export const isASCII = /^[ -~]+$/; //https://catonmat.net/my-favorite-regex
|
|
export const isASCIIorEmpty = /^$|^[ -~]+$/; //https://catonmat.net/my-favorite-regex
|
|
export const isNotEmpty = /\S/;
|