You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
aggregation-platform/src/com/platform/utils/Support.java

32 lines
843 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/**
* 文件名 : Support.java
* 版权 : <版权/公司名>
* 描述 : <描述>
* @author liliy
* 版本 : <版本>
* 修改时间: 2016年9月12日
* 修改内容: <修改内容>
*/
package com.platform.utils;
import java.util.regex.Pattern;
/**
* <一句话功能简述>
* <功能详细描述>
* @author liliy
* @version [版本号2016年9月12日]
* @see [相关类/方法]
* @since [产品/模块版本]
*/
public class Support {
public static boolean checkIP(String str) {
Pattern pattern = Pattern
.compile("^((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5]"
+ "|[*])\\.){3}(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5]|[*])$");
return pattern.matcher(str).matches();
}
}