We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 323c414 commit d84eb9bCopy full SHA for d84eb9b
web/helpers/string.helper.ts
@@ -270,7 +270,7 @@ export const isCommentEmpty = (comment: string | undefined): boolean => {
270
export const checkURLValidity = (url: string): boolean => {
271
if (!url) return false;
272
// regex to match valid URLs (with or without http/https)
273
- const urlPattern = /^(https?:\/\/)?([\w.-]+\.[a-z]{2,6})(\/[\w\-.~:/?#[\]@!$&'()*+,;=%]*)?$/i;
+ const urlPattern = /^(https?:\/\/)?([\da-z.-]+)\.([a-z]{2,6})(\/[\w.-]*)*\/?(\?[=&\w.-]*)?$/i;
274
// test if the URL matches the pattern
275
return urlPattern.test(url);
276
};
0 commit comments