要求以Boolean的形式返回字符串参数是否为合法的URL格式。 注意:协议仅为HTTP(S) const isUrl = url => { const reg = /^(http|https)?:\/\/\w+(\.[\w.-])+\.[a-zA-Z]{2,6}/g return reg.test(url) }