From f1635e2de76bb151f26a478496da1751d9ffe5a0 Mon Sep 17 00:00:00 2001 From: Adhiraj Singh Date: Mon, 24 Oct 2022 15:48:58 +0530 Subject: [PATCH] chore: update URL regex --- src/Defaults/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Defaults/index.ts b/src/Defaults/index.ts index b5581f2..e6c6e00 100644 --- a/src/Defaults/index.ts +++ b/src/Defaults/index.ts @@ -20,7 +20,7 @@ export const NOISE_WA_HEADER = Buffer.from( [ 87, 65, 6, DICT_VERSION ] ) // last is "DICT_VERSION" /** from: https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url */ -export const URL_REGEX = /[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)?/gi +export const URL_REGEX = /(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/ export const URL_EXCLUDE_REGEX = /.*@.*/ export const WA_CERT_DETAILS = {