improve url regex

This commit is contained in:
Eduard Heimbuch
2020-12-03 09:47:41 +01:00
parent 715c76e2f4
commit 11755d3980
2 changed files with 5 additions and 6 deletions

View File

@@ -50,7 +50,7 @@ export const isPathValid = (path: string) => {
return pathRegex.test(path);
};
const urlRegex = /^(ssh|ftp|https?):\/\/[^\s$.?#].[^\s]*$/;
const urlRegex = /^[A-Za-z0-9]+:\/\/[^\s$.?#].[^\s]*$/;
export const isUrlValid = (url: string) => {
return urlRegex.test(url);