🩹 fix and simplify regex #5
@ -127,7 +127,7 @@ function dnswatch_search() {
|
||||
|
||||
|
||||
function is_valid_domain(str) {
|
||||
let regex = /^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$/;
|
||||
let regex = /^([a-z0-9\-]+\.)+[a-z0-9]{2,}$/;
|
||||
return regex.test(str);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user