| | |
| | | import java.lang.reflect.Method;
|
| | | import java.security.MessageDigest;
|
| | | import java.security.NoSuchAlgorithmException;
|
| | | import java.util.List;
|
| | | import java.util.regex.Matcher;
|
| | | import java.util.regex.Pattern;
|
| | |
|
| | |
| | | // 是否为电话号码
|
| | | public static boolean isMobile(String mobile) {
|
| | |
|
| | | String regex = "^((13[0-9])|(17[0-9])|(15[^4,\\D])|(18[0-9])|(19[0-9])|(16[0-9]))\\d{8}$";
|
| | | String regex = "^((13[0-9])|(14[0-9])|(17[0-9])|(15[^4,\\D])|(18[0-9])|(19[0-9])|(16[0-9]))\\d{8}$";
|
| | | Pattern p = Pattern.compile(regex);
|
| | | Matcher m = p.matcher(mobile);
|
| | |
|
| | |
| | | }
|
| | | return code;
|
| | | }
|
| | | |
| | |
|
| | | public static String getVerifyCode(int count) {
|
| | | String sts = "0123456789";
|
| | | String code = "";
|
| | |
| | | }
|
| | | return code;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | // ��ȡ���ŷ��͵ĸ�ʽ
|
| | | public static String getMessageStyle(String code) {
|
| | |
| | | }
|
| | |
|
| | | public static boolean isJson(String content) {
|
| | | try {
|
| | | JSONObject.fromObject(content);
|
| | | return true;
|
| | | } catch (Exception e) {
|
| | | return false;
|
| | | }
|
| | | }
|
| | | try {
|
| | | JSONObject.fromObject(content);
|
| | | return true;
|
| | | } catch (Exception e) {
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
|
| | | public static String concat(List list, String sperator) {
|
| | | if (list == null)
|
| | | return null;
|
| | | String str = "";
|
| | | for (Object obj : list) {
|
| | | str += obj + sperator;
|
| | | }
|
| | | if (str.endsWith(sperator))
|
| | | str = str.substring(0, str.length() - sperator.length());
|
| | | return str;
|
| | | }
|
| | | |
| | | public static String concat(Object[] array, String sperator) {
|
| | | if (array == null)
|
| | | return null;
|
| | | |
| | | String str = "";
|
| | | for (int i = 0; i < array.length; i++) {
|
| | | str += array[i] + sperator;
|
| | | }
|
| | | |
| | | if (str.endsWith(sperator))
|
| | | str = str.substring(0, str.length() - sperator.length());
|
| | | return str;
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 淘口令提取
|
| | | * |
| | | * @param str
|
| | | * @return
|
| | | */
|
| | | public static String picUpTaoToken(String str) {
|
| | | String pattern = "(₳{1}[A-Za-z0-9]+₳{1})|(¥{1}[A-Za-z0-9]+¥{1})|(¥{1}[A-Za-z0-9]+¥{1})";
|
| | | Pattern r = Pattern.compile(pattern);
|
| | | Matcher m = r.matcher(str);
|
| | | while (m.find()) {
|
| | | String group = m.group(0);
|
| | | if (!StringUtil.isNullOrEmpty(group))
|
| | | return group;
|
| | | }
|
| | | return null;
|
| | | }
|
| | | }
|