diff --git a/utils/string-utils.class.ts b/utils/string-utils.class.ts index ced29bc7..61d45b48 100644 --- a/utils/string-utils.class.ts +++ b/utils/string-utils.class.ts @@ -261,9 +261,9 @@ export class Identifier { export class StringUtils { - public static urlRegex = 'https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.' + - '[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.' + - '[a-zA-Z0-9]+\.[^\s]{2,}'; + public static urlRegex = 'https?:\\/\\/(?:www(2?)\\.|(?!www(2?)))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|www(2?)\\.' + + '[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|https?:\\/\\/(?:www(2?)\\.|(?!www(2?)))[a-zA-Z0-9]+\\.[^\\s]{2,}|www(2?)\\.' + + '[a-zA-Z0-9]+\\.[^\\s]{2,}'; public static routeRegex = '^[a-zA-Z0-9\/][a-zA-Z0-9\/-]*$';