在网上找到匹配一级二级三级域名的正则是这样的
// 一级域名提取
private static final String RE_TOP1 = "(\w*\.?){1}\.(com.cn|net.cn|gov.cn|org\.nz|org.cn|com|net|org|gov|cc|biz|info|cn|co)$";
// 二级域名提取
private static final String RE_TOP2 = "(\w*\.?){2}\.(com.cn|net.cn|gov.cn|org\.nz|org.cn|com|net|org|gov|cc|biz|info|cn|co)$";
// 三级域名提取
private static final String RE_TOP3 = "(\w*\.?){3}\.(com.cn|net.cn|gov.cn|org\.nz|org.cn|com|net|org|gov|cc|biz|info|cn|co)$";
但是这要匹配三次才行,我现在要匹配一次就能区分出来一级二级三级域名,就是把上面的三个规则融合成一个规则