javascirpt 幾個驗證輸入類型經(jīng)典寫法
javascirpt 幾個驗證輸入類型經(jīng)典寫法:
//檢查是否為任意數(shù)(實數(shù)); function;isNumeric(strNumber);{; var;newPar=/^(-;¦+)?d+(.d+)?$/; alert(newPar.test(strNumber));}; //檢查是否為正數(shù); function;isUnsignedNumeric(strNumber);{; var;newPar=/^d+(.d+)?$/; alert(newPar.test(strNumber));;}; //檢查是否為整數(shù); function;isInteger(strInteger);{; var;newPar=/^(-;¦+)?d+$/; alert(newPar.test(strInteger));;}; //檢查是否為正整數(shù); function;isUnsignedInteger(strInteger);{; var;newPar=/^d+$/; alert(newPar.test(strInteger));}; "^d+$"http://非負整數(shù)(正整數(shù);+;0) "^[0-9]*[1-9][0-9]*$"http://正整數(shù) "^((-d+)|(0+))$"http://非正整數(shù)(負整數(shù);+;0) "^-[0-9]*[1-9][0-9]*$"http://負整數(shù) "^-?d+$"http://整數(shù) "^d+(.d+)?$"http://非負浮點數(shù)(正浮點數(shù);+;0) "^(([0-9]+.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*.[0-9]+)|([0-9]*[1-9][0-9]*))$"http://正浮點數(shù) "^((-d+(.d+)?)|(0+(.0+)?))$"http://非正浮點數(shù)(負浮點數(shù);+;0) "^(-(([0-9]+.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*.[0-9]+)|([0-9]*[1-9][0-9]*)))$"http://負浮點數(shù) "^(-?d+)(.d+)?$"http://浮點數(shù) "^[A-Za-z]+$"http://由26個英文字母組成的字符串 "^[A-Z]+$"http://由26個英文字母的大寫組成的字符串 "^[a-z]+$"http://由26個英文字母的小寫組成的字符串 "^[A-Za-z0-9]+$"http://由數(shù)字和26個英文字母組成的字符串 "^w+$"http://由數(shù)字、26個英文字母或者下劃線組成的字符串 "^[w-]+(.[w-]+)*@[w-]+(.[w-]+)+$"http://email地址 "^[a-zA-z]+://(w+(-w+)*)(.(w+(-w+)*))*(?S*)?$"http://url
相關文章:
1. Spring MVC+ajax進行信息驗證的方法2. Idea中maven項目實現(xiàn)登錄驗證碼功能3. Spring Security 實現(xiàn)短信驗證碼登錄功能4. Springboot 如何實現(xiàn)filter攔截token驗證和跨域5. Python驗證碼截取識別代碼實例6. 使用AJAX(包含正則表達式)驗證用戶登錄的步驟7. Android 簡單的實現(xiàn)滑塊拼圖驗證碼功能8. ASP.NET MVC遍歷驗證ModelState的錯誤信息9. 原生java代碼實現(xiàn)碼云第三方驗證登錄的示例代碼10. java自定義注解驗證手機格式的實現(xiàn)示例

網(wǎng)公網(wǎng)安備