mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-10 09:53:48 +00:00
0500368982
* Revert "refactor: allow messages not starting with http" This reverts commit887e5c448e. * Revert "refactor: allow messages not starting with http" This reverts commit6ce275da7a.
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/;
|