From 2ce6d5df6dc8f36bf3646f8a280825697a0e7911 Mon Sep 17 00:00:00 2001 From: BluJ Date: Mon, 15 May 2023 10:44:40 -0600 Subject: [PATCH] chore: Remove the requirement of http --- lib/util/regexes.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/util/regexes.ts b/lib/util/regexes.ts index 6c1cf37..55b5a84 100644 --- a/lib/util/regexes.ts +++ b/lib/util/regexes.ts @@ -8,15 +8,15 @@ export const ipv4 = // https://ihateregex.io/expr/url/ export const url = - /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()!@:%_\+.~#?&\/\/=]*)/ + /(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()!@:%_\+.~#?&\/\/=]*)/ export const local = - /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.local\b([-a-zA-Z0-9()!@:%_\+.~#?&\/\/=]*)/ + /(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.local\b([-a-zA-Z0-9()!@:%_\+.~#?&\/\/=]*)/ export const localHost = /[-a-zA-Z0-9@:%._\+~#=]{1,256}\.local/ export const onion = - /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.onion\b([-a-zA-Z0-9()!@:%_\+.~#?&\/\/=]*)/ + /(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.onion\b([-a-zA-Z0-9()!@:%_\+.~#?&\/\/=]*)/ export const onionHost = /[-a-zA-Z0-9@:%._\+~#=]{1,256}\.onion/ // https://ihateregex.io/expr/ascii/