匹配首尾空白字符的正则表达式:^s*|s*$ 评注:可以用来删除行首行尾的空白字符(包括空格、制表符、换页符等等),非常有用的表达式.
匹配首尾空白字符的正则表达式:^s*|s*$
- $action = trim($_get['action']);
- if($action == "sub")
- {
- $str = $_post['dir'];
- //if(!preg_match("/^[".chr(0xa1)."-".chr(0xff)."a-za-z0-9_]+$/",$str)) //gb2312汉字字母数字下划线正则表达式
- if(!preg_match("/^[x{4e00}-x{9fa5}a-za-z0-9_]+$/u",$str)) //utf-8汉字字母数字下划线正则表达式
- {
- echo "<font color=red>您输入的[".$str."]含有违法字符</font>";
- }
- else
- {
- echo "<font color=green>您输入的[".$str."]完全合法,通过!</font>";
- }
- }
- ?>
- <form method="post" action="">
- 输入字符(数字,字母,汉字,下划线):
- <input type="text" name="dir" value="">
- <input type="submit" value="提交">
- </form>
匹配网址url的正则表达式:[a-za-z]+://[^s]*
评注:网上流传的版本功能很有限,上面这个基本可以满足需求
匹配帐号是否合法(字母开头,允许5-16字节,允许字母数字下划线):^[a-za-z][a-za-z0-9_]{4,15}$
评注:表单验证时很实用
匹配国内电话号码:d{3}-d{8}|d{4}-d{7}
评注:匹配形式如 0511-4405222 或 021-87888822
匹配腾讯qq号:[1-9][0-9]{4,}
评注:腾讯qq号从10000开始
匹配中国邮政编码:[1-9]d{5}(?!d)
评注:中国邮政编码为6位数字
匹配身份证:d{15}|d{18}
评注:中国的身份证为15位或18位
匹配ip地址:d+.d+.d+.d+
评注:提取ip地址时有用
波比源码 – 精品源码模版分享 | www.bobi11.com
1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长!
2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 本站源码并不保证全部能正常使用,仅供有技术基础的人学习研究,请谨慎下载
8. 如遇到加密压缩包,请使用WINRAR解压,如遇到无法解压的请联系管理员!
波比源码 » php 汉字字母数字下划线正则表达式
波比源码 » php 汉字字母数字下划线正则表达式
buy levaquin sale levofloxacin 500mg sale
order avodart 0.5mg pills celebrex 100mg without prescription buy ondansetron pills
spironolactone pill propecia 1mg us diflucan 200mg brand
ampicillin 250mg for sale bactrim for sale online erythromycin 500mg without prescription
buy sildenafil 100mg online cheap careprost price robaxin 500mg drug
buy suhagra for sale purchase estradiol sale buy estradiol online cheap
accutane order purchase azithromycin azithromycin 500mg brand
buy arimidex 1 mg generic brand anastrozole 1 mg buy viagra 50mg for sale
cialis en france viagra 200mg generique en pharmacie viagra 25mg sans ordonnance
tadalafil 10mg ohne rezept viagra 200mg generika rezeptfrei kaufen sildenafil generika
isotretinoin 20mg over the counter buy amoxil 1000mg ivermectin australia
order generic modafinil 200mg buy provigil for sale diamox usa
ramipril order online ramipril cheap astelin 10 ml over the counter
alendronate 35mg pill buy fosamax 70mg for sale pepcid 20mg brand
benicar 20mg cost divalproex 500mg canada order diamox 250 mg online cheap
tacrolimus 5mg drug buy trandate generic buy ursodiol sale
order generic bupropion 150mg zyban 150mg without prescription order quetiapine 100mg online cheap
buy tadalafil 10mg online cheap cialis sale order symmetrel generic
buy dapsone generic order perindopril online perindopril over the counter
provigil 100mg generic order modafinil pill can you buy stromectol over the counter
zithromax online order azithromycin 500mg canada neurontin 100mg sale
tadalafil 20mg canada clomipramine us buy anafranil 25mg online cheap
oral chloroquine 250mg order olumiant pill order generic olumiant
sporanox for sale purchase itraconazole generic buy tindamax pills
glucophage medication order cialis 40mg for sale cialis 20mg ca
linezolid for sale jackpot party casino live blackjack
omeprazole 20mg drug online casino for real cash casino games free
help with essays pfizer viagra viagra 100mg ca
cialis for sale cialis coupon cvs viagra 25mg for sale
cialis 20mg oral order viagra 100mg for sale cheap viagra pills
zyloprim sale oral zetia ezetimibe 10mg drug
order zantac 300mg online cheap order zantac 150mg online cheap cheap celebrex 100mg
cost tamsulosin flomax online order brand spironolactone
flagyl 200mg pill order bactrim 960mg pills cheap bactrim
fluconazole 100mg cost cheap viagra 50mg buy viagra 100mg pill
order sildenafil for sale buy sildenafil tablets cialis 40mg price
custom dissertation help with term paper ivermectin 6 mg pills for humans
play roulette ed pills no prescription tadalafil 5mg pill
buy retin cream sale buy tretinoin gel order avanafil 100mg online cheap
buy lamisil 250mg without prescription lamisil sale amoxicillin cheap
biaxin 500mg oral purchase biaxin pill antivert 25 mg pill
cost spiriva order terazosin 1mg without prescription oral terazosin 1mg
buy generic actos 30mg viagra pills generic viagra 50mg
order cialis generic tadalafil tablet tadalafil 5mg us
online gambling for real money online blackjack game real online blackjack
free slot games for fun burton brunette casinos online
play slots most reliable online pharmacy college essay for sale
buy diamox 250 mg for sale buy acetazolamide online oral imuran 25mg
dapoxetine us buy generic dapoxetine 60mg motilium cost
buy indomethacin online cheap indomethacin drug cenforce 50mg oral
tadalafil 20mg brand trimox ca amoxicillin 500mg canada
nexium for sale order lasix for sale buy furosemide
order minocin 100mg online minocycline 50mg generic hytrin 1mg sale
order glycomet 500mg for sale buy verapamil 240mg generic order nolvadex 10mg online cheap
buy ivermectin for humans australia stromectol 6mg for sale deltasone 5mg canada
cheap accutane purchase amoxil pill order azithromycin 250mg pills
cost prednisolone 5mg order prednisolone 20mg pill buy lasix pill
buy promethazine generic buy phenergan online cheap generic tadalafil 40mg
coumadin 2mg tablet order reglan 10mg sale zyloprim 100mg usa