後端常用字段驗證

2021-10-01 06:12:18 字數 1960 閱讀 2382

/* 驗證郵箱 */

public static boolean isemail(string input) $";

return pattern.matches(reg, input);

} /* 驗證手機號 */

public static boolean isphone(string input) )|(0\\\\d-\\\\d)|(0\\\\d-\\\\d)$";

return pattern.matches(reg, input);

} /* 驗證座機號 */

public static boolean istel(string input) \\\\)|\\\\d-|\\\\s)?\\\\d";

return pattern.matches(reg, input);

} /* 驗證傳真 */

public static boolean isfax(string input) (\\\\d)[ ]?([-]?((\\\\d)|[ ]))+$";

return pattern.matches(reg, input);

} /* 驗證郵編號碼 */

public static boolean iscode(string input) $";

return pattern.matches(reg, input);

} /* 驗證是否正確的網路位址 */

public static boolean isinterneturl(string input)

/* 驗證正確的姓名 */

public static boolean isname(string input) |[\\u4e00-\\u9fa5]";

return pattern.matches(reg, input);

} /* 驗證正確的英文名 */

public static boolean isename(string input) ";

return pattern.matches(reg, input);

} /* 驗證正確的日期格式 */

public static boolean isdata(string input) )-(0?[13578]|1[02])-(0?[1-9]|[12]\\d|3[01]))|"

+ "(((1[6-9]|[2-9]\\d)\\d)-(0?[13456789]|1[012])-(0?[1-9]|[12]\\d|30))|"

+ "(((1[6-9]|[2-9]\\d)\\d)-0?2-(0?[1-9]|1\\d|2[0-8]))|"

+ "(((1[6-9]|[2-9]\\d)(0[48]|[2468][048]|[13579][26])|" + "((16|[2468][048]|[3579][26])00))-0?2-29-))$";

return pattern.matches(reg, input);

} /* 驗證是否是sql語句 */

public static boolean issql(string input)

/* 驗證是否為ip */

public static boolean isip(string input) |1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|1\\d\\d|2[0-4]\\d|25[0-5])$";

return pattern.matches(reg, input);

} /* 驗證是否為url */

public static boolean isurl(string input)

/* 驗證身份證號 */

public static boolean checkidcard(string id) else

return check;

}

mysql 常用字段型別 mysql 常用字段型別

tinyint m unsigned zerofill 1位元組 極小整數,資料型別用於儲存一些範圍的整數數值範圍 有符號 128 127.無符號 255 特別的 mysql中無布林值,使用tinyint 1 構造。smallint 2位元組 小整數有符號 32768 無符號 65535 mediu...

HTTP協議常用字段

uri 統一資源識別符號,不僅可以標識http,ftp等其他的網路資源 url 統一資源定位符 get 獲取乙個資源,同時引數直接跟在url後面,url長度受限制2048位元組 post 不僅可以獲取資源,還可以提交資源 譬如上傳檔案 引數放在請求體中,包大小4g head 只要響應頭,沒有響應體,...

Oracle常用字段型別

數字 number 8,3 數字型 一共8位 小數點後3位 decimal p,s 數字型別 integer 整數型別 小整數 float 浮點數型別 38位 雙精度 real 字元 varchar2 20 變長字串 2的優勢是國際化 長度0 4096 4k char n 定長字串 定長優勢 查詢時...