removed unnecessary ipToRegex function