Skip to content

Commit

Permalink
refactored validatAgencyURL function's regex
Browse files Browse the repository at this point in the history
  • Loading branch information
corypride committed May 10, 2024
1 parent 1c27f6c commit 8cf4bf8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions common/utils/helperUtils.ts
Expand Up @@ -281,8 +281,7 @@ export const validateEmail = (email: string | undefined) => {
};

export const validateAgencyURL = (url: string) => {
const urlRegex =
/^(?:(?:https?|ftp):\/\/)?(?:[\w.-]{1,63}\.){1,}[a-zA-Z]{2,}(?:\/\S*)?$/;
const urlRegex = /^(?:(?:https?|ftp):\/\/)?[\w.-]+\.[a-zA-Z]{2,}(?:\/\S*)?$/;
return urlRegex.test(url);
};

Expand Down

0 comments on commit 8cf4bf8

Please sign in to comment.