Java正则表达式(二)、常用正则工具类(三)

2014-11-24 08:34:35 · 作者: · 浏览: 1
0");
Assert.assertTrue(result);
}

/**
* 验证URL地址
*/
@Test
public void testCheckURL() {
boolean result = RegexUtils.checkURL("http://blog.csdn.com:80/xyang81/article/details name=&abc=中文");
Assert.assertTrue(result);
}

/**
* 验证IP地址
*/
@Test
public void testCheckIpAddress() {
boolean result = RegexUtils.checkIpAddress("192.1.22.255");
Assert.assertTrue(result);
}
}
测试结果: