Skip to content

Commit 4b01963

Browse files
authored
Update scripts.js
1 parent 2c82b3e commit 4b01963

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

scripts.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,14 @@ document.addEventListener("DOMContentLoaded", () => {
116116
// Validate IP address format
117117
function validateIP(ip) {
118118
const regex =
119-
/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
119+
/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
120120
return regex.test(ip);
121121
}
122122

123123
// Validate URL format
124124
function validateURL(url) {
125125
const regex =
126-
/^(https?:\/\/)?(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z]{2,6}(:[0-9]{1,5})?(\/.*)?$/i;
126+
/^(https?:\\/\\/)?(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z]{2,6}(:[0-9]{1,5})?(\\/.*)?$/i;
127127
return regex.test(url);
128128
}
129129
});

0 commit comments

Comments
 (0)