((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)
Pattern p=Pattern.compile("((2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.){3}(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)");
Matcher m=p.matcher(strint);
if(m.find())
{
//headers.put("ip",m.group());
}
原文:http://www.cnblogs.com/wenqianggg/p/6837848.html