ÔËά±Ø±¸£¬ÕýÔò±í´ïʽ³¬È«ËÙ²éÊֲᣬ¸ÏæÕä²Ø£¡
^[0-9]*$nλµÄÊý×Ö£º^d{n}$ÖÁÉÙnλµÄÊý×Ö£º^d{n,}$m-nλµÄÊý×Ö£º^d{m,n}$ÁãºÍ·ÇÁ㿪ͷµÄÊý×Ö£º^(0|[1-9][0-9]*)$·ÇÁ㿪ͷµÄ×î¶à´øÁ½Î»Ð¡ÊýµÄÊý×Ö£º^([1-9][0-9]*)+(.[0-9]{1,2})?$´ø1-2λСÊýµÄÕýÊý»ò¸ºÊý£º^(-)?d+(.d{1,2})?$ÕýÊý¡¢¸ºÊý¡¢ºÍСÊý£º^(-|+)?d+(.d+)?$ÓÐÁ½Î»Ð¡ÊýµÄÕýʵÊý£º^[0-9]+(.[0-9]{2})?$ÓÐ1~3λСÊýµÄÕýʵÊý£º^[0-9]+(.[0-9]{1,3})?$·ÇÁãµÄÕýÕûÊý£º^[1-9]d*$ »ò ^([1-9][0-9]*){1,3}$ »ò ^+?[1-9][0-9]*$·ÇÁãµÄ¸ºÕûÊý£º^-[1-9][]0-9"*$ »ò ^-[1-9]d*$
µÇ¼ºó¸´ÖÆ
·Ç¸ºÕûÊý£º^d+$ »ò ^[1-9]d*|0$
·ÇÕýÕûÊý£º^-[1-9]d*|0$ »ò ^((-d+)|(0+))$
·Ç¸º¸¡µãÊý£º^d+(.d+)?$ »ò ^[1-9]d*.d*|0.d*[1-9]d*|0?.0+|0$
·ÇÕý¸¡µãÊý£º^((-d+(.d+)?)|(0+(.0+)?))$ »ò ^(-([1-9]d*.d*|0.d*[1-9]d*))|0?.0+|0$
Õý¸¡µãÊý£º^[1-9]d*.d*|0.d*[1-9]d*$ »ò ^(([0-9]+.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*.[0-9]+)|([0-9]*[1-9][0-9]*))$
¸º¸¡µãÊý£º^-([1-9]d*.d*|0.d*[1-9]d*)$ »ò ^(-(([0-9]+.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*.[0-9]+)|([0-9]*[1-9][0-9]*)))$
¸¡µãÊý£º^(-?d+)(.d+)?$ »ò ^-?([1-9]d*.d*|0.d*[1-9]d*|0?.0+|0)$
¶þ¡¢Ð£Ñé×Ö·ûµÄ±í´ïʽ
ºº×Ö£º^[u4e00-u9fa5]{0,}$
Ó¢ÎĺÍÊý×Ö£º^[A-Za-z0-9]+$ »ò ^[A-Za-z0-9]{4,40}$
³¤¶ÈΪ3-20µÄËùÓÐ×Ö·û£º^.{3,20}$
ÓÉ26¸öÓ¢ÎÄ×Öĸ×é³ÉµÄ×Ö·û´®£º^[A-Za-z]+$
ÓÉ26¸ö´óдӢÎÄ×Öĸ×é³ÉµÄ×Ö·û´®£º^[A-Z]+$
ÁíÍ⣬ËÑË÷ÃñÖÚºÅJavaºó¶ËÕ»ºǫ́»Ø¸´¡°Ë½»î¡±£¬»ñÈ¡Ò»·Ý¾ªÏ²Àñ°ü¡£
ÓÉ26¸öСдӢÎÄ×Öĸ×é³ÉµÄ×Ö·û´®£º^[a-z]+$
ÓÉÊý×ÖºÍ26¸öÓ¢ÎÄ×Öĸ×é³ÉµÄ×Ö·û´®£º^[A-Za-z0-9]+$
ÓÉÊý×Ö¡¢26¸öÓ¢ÎÄ×Öĸ»òÕßÏ»®Ïß×é³ÉµÄ×Ö·û´®£º^w+$ »ò ^w{3,20}
ÖÐÎÄ¡¢Ó¢ÎÄ¡¢Êý×Ö°üÀ¨Ï»®Ïߣº^[u4E00-u9FA5A-Za-z0-9_]+$
ÖÐÎÄ¡¢Ó¢ÎÄ¡¢Êý×Öµ«²»°üÀ¨Ï»®ÏߵȷûºÅ£º^[u4E00-u9FA5A-Za-z0-9]+$ »ò ^[u4E00-u9FA5A-Za-z0-9]{2,20}$
¿ÉÒÔÊäÈ뺬ÓÐ^%&’,;=?$” µÈ×Ö·û£º[^%&’,;=?$x22]+
եȡÊäÈ뺬ÓÐ~µÄ×Ö·û [^~x22]+
ÆäËü
.*Æ¥Åä³ý n ÒÔÍâµÄÈκÎ×Ö·û¡£/[u4E00-u9FA5]/ ºº×Ö/[uFF00-uFFFF]/ È«½Ç·ûºÅ/[u0000-u00FF]/ °ë½Ç·ûºÅ
µÇ¼ºó¸´ÖÆ
Èý¡¢ÌØÊâÐèÇó±í´ïʽ
Email µØµã£º^w+([-+.]w+)*@w+([-.]w+)*.w+([-.]w+)*$
[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(/.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+/.?
µÇ¼ºó¸´ÖÆ
[a-zA-z]+://[^s]* »ò ^http://([w-]+.)+[w-]+(/[w-./?%&=]*)?$
µÇ¼ºó¸´ÖÆ
^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])d{8}$
µÇ¼ºó¸´ÖÆ
µç»°ºÅÂë(¡°XXX-XXXXXXX¡±¡¢¡±XXXX-XXXXXXXX¡±¡¢¡±XXX-XXXXXXX¡±¡¢¡±XXX-XXXXXXXX¡±¡¢¡±XXXXXXX¡±ºÍ¡±XXXXXXXX)£º^((d{3,4}-)|d{3.4}-)?d{7,8}$
º£Äڵ绰ºÅÂë(0511-4405222¡¢021-87888822)£ºd{3}-d{8}|d{4}-d{7}
Éí·ÝÖ¤ºÅ(15λ¡¢18λÊý×Ö)£º^d{15}|d{18}$
¶ÌÉí·ÝÖ¤ºÅÂë(Êý×Ö¡¢×Öĸx×îºó)£º^([0-9]){7,18}(x|X)?$ »ò ^d{8,18}|[0-9x]{8,18}|[0-9X]{8,18}?$
ÕʺÅÊÇ·ñÕýµ±(×Öĸ¿ªÍ·£¬ÔÊÐí5-16×Ö½Ú£¬ÔÊÐí×ÖĸÊý×ÖÏ»®Ïß)£º^[a-zA-Z][a-zA-Z0-9_]{4,15}$
ÃÜÂë(ÒÔ×Öĸ¿ªÍ·£¬³¤¶ÈÔÚ6~18Ö®¼ä£¬Ö»ÄÜ°üÀ¨×Öĸ¡¢Êý×ÖºÍÏ»®Ïß)£º^[a-zA-Z]w{5,17}$
Ç¿ÃÜÂë(±ØÐè°üÀ¨¾Þϸд×ÖĸºÍÊý×ÖµÄ×éºÏ£¬²»¿ÉʹÓÃÌØÊâ×Ö·û£¬³¤¶ÈÔÚ8-10Ö®¼ä)£º^(?=.*d)(?=.*[a-z])(?=.*[A-Z]).{8,10}$
ÈÕÆÚÃûÌãº^d{4}-d{1,2}-d{1,2}
Ò»ÄêµÄ12¸öÔÂ(01¡«09ºÍ1¡«12)£º^(0?[1-9]|1[0-2])$
Ò»¸öÔµÄ31Ìì(01¡«09ºÍ1¡«31)£º^((0?[1-9])|((1|2)[0-9])|30|31)$
Ç®µÄÊäÈëÃûÌÃ
ÓÐËÄÖÖÇ®µÄÌåÏÖÐÎʽÎÒÃÇ¿ÉÒÔ½ÓÊÜ:¡±10000.00¡± ºÍ ¡°10,000.00¡±, ºÍûÓÐ ¡°·Ö¡± µÄ ¡°10000¡± ºÍ ¡°10,000¡±£º^[1-9][0-9]*$
ÕâÌåÏÖí§ÒâÒ»¸ö²»ÒÔ0¿ªÍ·µÄÊý×Ö,¿ÉÊÇ,ÕâÒ²Òâζ×ÅÒ»¸ö×Ö·û¡±0¡±Ç·ºà¹ý,ÒÔÊÇÎÒÃǽÓÄÉÏÂÃæµÄÐÎʽ£º^(0|[1-9][0-9]*)$
Ò»¸ö0»òÕßÒ»¸ö²»ÒÔ0¿ªÍ·µÄÊý×Ö.ÎÒÃÇ»¹¿ÉÒÔÔÊÐí¿ªÍ·ÓÐÒ»¸ö¸ººÅ£º^(0|-?[1-9][0-9]*)$
4.ÕâÌåÏÖÒ»¸ö0»òÕßÒ»¸ö¿ÉÄÜΪ¸ºµÄ¿ªÍ·²»Îª0µÄÊý×Ö.ÈÃÓû§ÒÔ0¿ªÍ·ºÃÁË.°Ñ¸ººÅµÄҲȥµô,ÓÉÓÚÇ®×ܲ»¿ÉÊǸºµÄ°É.ÏÂÃæÎÒÃÇÒª¼ÓµÄÊÇ˵Ã÷¿ÉÄܵÄСÊý²¿·Ö£º^[0-9]+(.[0-9]+)?$
±ØÐè˵Ã÷µÄÊÇ,СÊýµãºóÃæÖÁÉÙÓ¦¸ÃÓÐ1λÊý£¬ÒÔÊÇ¡±10.¡±ÊÇÇ·ºà¹ýµÄ,¿ÉÊÇ ¡°10¡± ºÍ ¡°10.2¡± ÊÇͨ¹ýµÄ£º^[0-9]+(.[0-9]{2})?$
ÕâÑùÎÒÃÇ»®¶¨Ð¡ÊýµãºóÃæ±ØÐèÓÐÁ½Î»£¬ÈôÊÇÄãÒÔΪ̫¿Á¿ÌÁË£¬¿ÉÒÔÕâÑù£º^[0-9]+(.[0-9]{1,2})?$
ÕâÑù¾ÍÔÊÐíÓû§Ö»Ð´Ò»Î»Ð¡Êý.ÏÂÃæÎÒÃǸÃ˼Á¿Êý×ÖÖÐµÄ ¶ººÅ ÁË£¬ÎÒÃÇ¿ÉÒÔÕâÑù£º^[0-9]{1,3}(,[0-9]{3})*(.[0-9]{1,2})?$
1µ½3¸öÊý×Ö,ºóÃæËæ×Åí§Òâ¸ö ¶ººÅ+3¸öÊý×Ö£¬¶ººÅ³ÉΪ¿ÉÑ¡£¬¶ø²»ÊDZØÐ裺^([0-9]+|[0-9]{1,3}(,[0-9]{3})*)(.[0-9]{1,2})?$
±¸×¢£ºÕâ¾ÍÊÇ×îÖÕЧ¹ûÁË,±ðÍüÁË+¿ÉÒÔÓÃ*Ìæ»»ÈôÊÇÄãÒÔΪ¿Õ×Ö·û´®Ò²¿ÉÒÔ½ÓÊܵĻ°(Ï£Ææ,Ϊʲô?)×îºó,±ðÍüÁËÔÚÓú¯ÊýʱȥµôÈ¥µôËÈË·´
µÇ¼ºó¸´ÖÆ
xmlÎļþ£º^([a-zA-Z]+-?)+[a-zA-Z0-9]+.[x|X][m|M][l|L]$
ÖÐÎÄ×Ö·ûµÄÕýÔò±í´ïʽ£º[u4e00-u9fa5]
Ë«×Ö½Ú×Ö·û£º^x00-xff)
¿ÕȱÐеÄÕýÔò±í´ïʽ£ºns*r (¿ÉÒÔÓÃÀ´É¾³ý¿ÕȱÐÐ)
HTML±ê¼ÇµÄÕýÔò±í´ïʽ£º<(S?)[^>]>.? |<.? /> (ÍøÉÏÈö²¥µÄ°æ±¾Ì«Ôã¸â£¬ÉÏÃæÕâ¸öÒ²½ö½öÄܲ¿·Ö£¬¹ØÓÚÖØ´óµÄǶÌ×±ê¼ÇÒÀ¾ÉÎÞÄÜΪÁ¦)
Ê×β¿Õȱ×Ö·ûµÄÕýÔò±í´ïʽ£º^s|s
) (¿ÉÒÔÓÃÀ´É¾³ýÐÐÊ×ÐÐβµÄ¿Õȱ×Ö·û(°üÀ¨¿Õ¸ñ¡¢ÖƱí·û¡¢»»Ò³·ûµÈµÈ)£¬ºÜÊÇÓÐÓõıí´ïʽ)
ÌÚѶQQºÅ£º[1-9][0-9]{4,}(ÌÚѶQQºÅ´Ó10000×îÏÈ)
ÖйúÓÊÕþ±àÂ룺[1-9]d{5}(?!d)(ÖйúÓÊÕþ±àÂëΪ6λÊý×Ö)
IPµØµã£ºd+.d+.d+.d+(ÌáÈ¡IPµØµãʱÓÐÓÃ)
IPµØµã£º((?:(?:25[0-5]|2[0-4]d|[01]?d?d).){3}(?:25[0-5]|2[0-4]d|[01]?d?d))
Å£±Æ°¡£¡½Ó˽»î±Ø±¸µÄ N ¸ö¿ªÔ´ÏîÄ¿£¡¸ÏæÕä²Ø°É
µÇ¼ºó¸´ÖÆ
IP-v4µØµã£ºb(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)b (ÌáÈ¡IPµØµãʱÓÐÓÃ)
УÑéIP-v6µØµã:
(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))
µÇ¼ºó¸´ÖÆ
×ÓÍøÑÚÂ룺
((?:(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d?\d))
µÇ¼ºó¸´ÖÆ
УÑéÈÕÆÚ:
^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$(¡°yyyy-mm-dd¡° ÃûÌõÄÈÕÆÚУÑ飬ÒÑ˼Á¿Æ½ÈòÄê¡£)
µÇ¼ºó¸´ÖÆ
³éȡעÊÍ£º
²éÕÒCSSÊôÐÔ:^\s*[a-zA-Z\-]+\s*[:]{1}\s[a-zA-Z0-9\s.#]+[;]{1}
ÌáÈ¡Ò³Ã泬Á´½Ó:(]*)(href=”https?:\/\/)((?!(?:(?:www\.)?’.implode(‘|(?:www\.)?’, $follow_list).’))[^” rel=”external nofollow” ]+)”((?!.*\brel=)[^>]*)(?:[^>]*)>
ÌáÈ¡ÍøҳͼƬ:\]*[src] *= *[\”\’]{0,1}([^\”\’\ >]*)
ÁíÍ⣬ËÑË÷ÃñÖÚºÅGitHubÔ³ºǫ́»Ø¸´¡°×¬Ç®¡±£¬»ñÈ¡Ò»·Ý¾ªÏ²Àñ°ü¡£
ÌáÈ¡ÍøÒ³ÑÕÉ«´úÂë:^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
ÎļþÀ©Õ¹ÃûЧÑé:^([a-zA-Z]\:|\\)\\([^\\]+\\)*[^\/:*?”|]+\.txt(l)?$
ÅжÏIE°æ±¾£º^.*MSIE [5-8](?:\.[0-9]+)?(?!.*Trident\/[5-9]\.0).*$
¸½±í:
ÒÔÉϾÍÊÇÔËά±Ø±¸£¬ÕýÔò±í´ïʽ³¬È«ËÙ²éÊֲᣬ¸ÏæÕä²Ø£¡µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡