Update index.js
Browse files
index.js
CHANGED
|
@@ -36,7 +36,7 @@ return response;
|
|
| 36 |
|
| 37 |
// isURL
|
| 38 |
function isUrl(url) {
|
| 39 |
-
let regex = new RegExp(/(https
|
| 40 |
if (!regex.test(url)) return false;
|
| 41 |
return url?.match(regex);
|
| 42 |
}
|
|
|
|
| 36 |
|
| 37 |
// isURL
|
| 38 |
function isUrl(url) {
|
| 39 |
+
let regex = new RegExp(/(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%.+~#=]{1,256}\.[a-zA-Z0-9()]{1,9}\b([-a-zA-Z0-9()@:%+.~#?&//=]*)/, 'gi');
|
| 40 |
if (!regex.test(url)) return false;
|
| 41 |
return url?.match(regex);
|
| 42 |
}
|