Skip to content

Commit d84eb9b

Browse files
committed
Revert "[WEB-2605] fix: update URL regex pattern to allow complex links. (#5767)"
This reverts commit 328b696.
1 parent 323c414 commit d84eb9b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

web/helpers/string.helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ export const isCommentEmpty = (comment: string | undefined): boolean => {
270270
export const checkURLValidity = (url: string): boolean => {
271271
if (!url) return false;
272272
// regex to match valid URLs (with or without http/https)
273-
const urlPattern = /^(https?:\/\/)?([\w.-]+\.[a-z]{2,6})(\/[\w\-.~:/?#[\]@!$&'()*+,;=%]*)?$/i;
273+
const urlPattern = /^(https?:\/\/)?([\da-z.-]+)\.([a-z]{2,6})(\/[\w.-]*)*\/?(\?[=&\w.-]*)?$/i;
274274
// test if the URL matches the pattern
275275
return urlPattern.test(url);
276276
};

0 commit comments

Comments
 (0)