JAVA ³£ÓõÄÕýÔò±í´ïʽ£º
Æ¥ÅäÌض¨Êý×Ö£º
^[1-9]d*$¡¡ ¡¡ //Æ¥ÅäÕýÕûÊý
^-[1-9]d*$ ¡¡ //Æ¥Å为ÕûÊý
^-?[1-9]d*$¡¡¡¡ //Æ¥ÅäÕûÊý
^[1-9]d*|0$¡¡ //Æ¥Åä·Ç¸ºÕûÊý£¨ÕýÕûÊý + 0£©
^-[1-9]d*|0$¡¡¡¡ //Æ¥Åä·ÇÕýÕûÊý£¨¸ºÕûÊý + 0£©
^[1-9]d*.d*|0.d*[1-9]d*$¡¡¡¡ //Æ¥ÅäÕý¸¡µãÊý
^-([1-9]d*.d*|0.d*[1-9]d*)$¡¡ //Æ¥Å为¸¡µãÊý
^-?([1-9]d*.d*|0.d*[1-9]d*|0?.0+|0)$¡¡ //Æ¥Å両µãÊý
^[1-9]d*.d*|0.d*[1-9]d*|0?.0+|0$¡¡¡¡ //Æ¥Åä·Ç¸º¸¡µãÊý£¨Õý¸¡µãÊý + 0£©
^(-([1-9]d*.d*|0.d*[1-9]d*))|0?.0+|0$¡¡¡¡//Æ¥Åä·ÇÕý¸¡µãÊý£¨¸º¸¡µãÊý + 0£©
ÆÀ×¢£º´¦Àí´óÁ¿Êý¾ÝʱÓÐÓ㬾ßÌåÓ¦ÓÃʱעÒâÐÞÕý
Æ¥ÅäÌض¨×Ö·û´®£º
^[A-Za-z]+$¡¡¡¡//Æ¥ÅäÓÉ26¸öÓ¢ÎÄ×Öĸ×é³ÉµÄ×Ö·û´®
^[A-Z]+$¡¡¡¡//Æ¥ÅäÓÉ26¸öÓ¢ÎÄ×ÖĸµÄ´óд×é³ÉµÄ×Ö·û´®
^[a-z]+$¡¡¡¡//Æ¥ÅäÓÉ26¸öÓ¢ÎÄ×ÖĸµÄСд×é³ÉµÄ×Ö·û´®
^[A-Za-z0-9]+$¡¡¡¡//Æ¥ÅäÓÉÊý×ÖºÍ26¸öÓ¢ÎÄ×Öĸ×é³ÉµÄ×Ö·û´®
^w+$¡¡¡¡//Æ¥ÅäÓÉÊý×Ö¡¢26¸öÓ¢ÎÄ×Öĸ»òÕßÏ»®Ïß×é³ÉµÄ×Ö·û´®
ÔÚʹÓÃRegularExpressionValidatorÑéÖ¤¿Ø¼þʱµÄÑéÖ¤¹¦Äܼ°ÆäÑéÖ¤±í´ïʽ½éÉÜÈçÏÂ:
Ö»ÄÜÊäÈëÊý×Ö£º“^[0-9]*$”
Ö»ÄÜÊäÈënλµÄÊý×Ö£º“^d{n}$”
Ö»ÄÜÊäÈëÖÁÉÙnλÊý×Ö£º“^d{n,}$”
Ö»ÄÜÊäÈëm-nλµÄÊý×Ö£º“^d{m,n}$”
Ö»ÄÜÊäÈëÁãºÍ·ÇÁ㿪ͷµÄÊý×Ö£º“^(0|[1-9][0-9]*)$”
Ö»ÄÜÊäÈëÓÐÁ½Î»Ð¡ÊýµÄÕýʵÊý£º“^[0-9]+(.[0-9]{2})?$”
Ö»ÄÜÊäÈëÓÐ1-3λСÊýµÄÕýʵÊý£º“^[0-9]+(.[0-9]{1,3})?$”
Ö»ÄÜÊäÈë·ÇÁãµÄÕýÕûÊý£º“^+?[1-9][0-9]*$”
Ö»ÄÜÊäÈë·ÇÁãµÄ¸ºÕûÊý£º“^-[1-9][0-9]*$”
Ö»ÄÜÊäÈ볤¶ÈΪ3µÄ×Ö·û£º“^.{3}$”
Ö»ÄÜÊäÈëÓÉ26¸öÓ¢ÎÄ×Öĸ×é³ÉµÄ×Ö·û´®£º“^[A-Za-z]+$”
Ö»ÄÜÊäÈëÓÉ26¸ö´óдӢÎÄ×Öĸ×é³ÉµÄ×Ö·û´®£º“^[A-Z]+$”
Ö»ÄÜÊäÈëÓÉ26¸öСдӢÎÄ×Öĸ×é³ÉµÄ×Ö·û´®£º“^[a-z]+$”
Ö»ÄÜÊäÈëÓÉÊý×ÖºÍ26¸öÓ¢ÎÄ×Öĸ×é³ÉµÄ×Ö·û´®£º“^[A-Za-z0-9]+$”
Ö»ÄÜÊäÈëÓÉÊý×Ö¡¢26¸öÓ¢ÎÄ×Öĸ»òÕßÏ»®Ïß×é³ÉµÄ×Ö·û´®£º“^w+$”
ÑéÖ¤Óû§ÃÜÂë:“^[a-zA-Z]w{5,17}$”ÕýÈ·¸ñʽΪ£ºÒÔ×Öĸ¿ªÍ·£¬³¤¶ÈÔÚ6-18Ö®¼ä£¬
Ö»ÄÜ°üº¬×Ö·û¡¢Êý×ÖºÍÏ»®Ïß¡£
ÑéÖ¤ÊÇ·ñº¬ÓÐ^%&’,;=?$”µÈ×Ö·û£º“[^%&’,;=?$x22]+”
Ö»ÄÜÊäÈ뺺×Ö£º“^[u4e00-u9fa5],{0,}$”
ÑéÖ¤Emai
Ïà¹ØÎĵµ£º
1.»ù±¾¸ÅÄîµÄÀí½â
¾ø¶Ô·¾¶£º¾ø¶Ô·¾¶¾ÍÊÇÄãµÄÖ÷Ò³ÉϵÄÎļþ»òĿ¼ÔÚÓ²ÅÌÉÏÕæÕýµÄ·¾¶£¬(URLºÍÎïÀí·¾¶)ÀýÈ磺
C:xyz est.txt ´ú±íÁËtest.txtÎļþµÄ¾ø¶Ô·¾¶¡£http://www.sun.com/index.htmÒ²´ú±íÁËÒ»¸öURL¾ø¶Ô·¾¶¡£
Ïà¶Ô·¾¶£ºÏà¶ÔÓëij¸ö»ù׼Ŀ¼µÄ·¾¶¡£°üº¬WebµÄÏà¶Ô·¾¶£¨HTMLÖеÄÏà¶ÔĿ¼£©£¬ÀýÈ磺ÔÚ
ServletÖУ¬ ......
¶¨ÒåÕâ¸ö¹æ·¶µÄÄ¿µÄÊÇÈÃÏîÄ¿ÖÐËùÓеÄÎĵµ¶¼¿´ÆðÀ´ÏñÒ»¸öÈËдµÄ£¬Ôö¼Ó¿É¶ÁÐÔ£¬¼õÉÙÏîÄ¿×éÖÐÒòΪ»»È˶ø´øÀ´µÄËðʧ¡££¨ÕâЩ¹æ·¶²¢²»ÊÇÒ»¶¨Òª¾ø¶Ô×ñÊØ£¬µ«ÊÇÒ»¶¨ÒªÈóÌÐòÓÐÁ¼ºÃµÄ¿É¶ÁÐÔ£©¡£
Java µÄÓï·¨Óë C++ ¼°ÎªÏàËÆ£¬ÄÇô£¬ÄãÖªµÀ Java µÄ×¢ÊÍÓм¸ÖÖÂð£¿ÊÇÁ½ÖÖ£¿ ¡¡¡¡
// ×¢ÊÍÒ»ÐС¡¡¡
/* ...... */ ×¢ÊÍÈô¸ÉÐÐ
²»ÍêÈ ......
ÄÚ²¿ÀàµÄʹÓõÄÓÅȱµã£º
Óŵ㣺¼õÉÙÁËÔÚÀàÎļþ±àÒëºóµÄ²úÉúµÄ×Ö½ÚÂëÎļþµÄ´óС
ȱµã£ºÊ¹³ÌÐò½á¹¹²»ÇåÎú
ʹÓÃÄÚ²¿ÀàµÄ×¢ÒâÊÂÏ
ÄÚ²¿ÀàµÄʹÓÃÒ»°ã¶¼ÓëËùÔÚµÄÍⲿÀàÓÐÒ»¶¨µÄ¹ØÁª£¬ËüÊÇÔÚÒ»¸öÀàµÄÄÚ²¿Ç¶Ì׶¨ÒåµÄÀ࣬Ëü¿ÉÒÔÊÇÆäËüÀàµÄ³ÉÔ±£¬Ò²¿ÉÒÔÔÚÒ»¸öÓï¾ä¿éµÄÄÚ²¿¶¨Ò壬»¹¿ÉÒÔÔÚ±í´ïʽÄÚ²¿ÄäÃû¶¨Òå(ÄäÃûÄÚ²¿Àà)¡£
ÄÚ²¿ ......
1£®Ç³¸´ÖÆÓëÉÖƸÅÄî
¢Ådz¸´ÖÆ£¨Ç³¿Ë¡£©
±»¸´ÖƶÔÏóµÄËùÓбäÁ¿¶¼º¬ÓÐÓëÔÀ´µÄ¶ÔÏóÏàͬµÄÖµ£¬¶øËùÓеĶÔÆäËû¶ÔÏóµÄÒýÓÃÈÔȻָÏòÔÀ´µÄ¶ÔÏó¡£»»ÑÔÖ®£¬Ç³¸´Öƽö½ö¸´ÖÆËù¿¼ÂǵĶÔÏ󣬶ø²»¸´ÖÆËüËùÒýÓõĶÔÏó¡£
¢ÆÉÖÆ£¨Éî¿Ë¡£©
±»¸´ÖƶÔÏóµÄËùÓбäÁ¿¶¼º¬ÓÐÓëÔÀ´µÄ¶ÔÏóÏàͬµÄÖµ£¬³ýÈ¥ÄÇЩÒýÓÃÆäËû¶ÔÏóµÄ±äÁ¿¡ ......
´«ÖDz¥¿ÍjavaÅàѵ2010Äê4ÔÂ10ÈÕajaxÔöÇ¿×ܽá1
½ñÌìµÄ¿Î£¬ÎÒÖ»ÄÜÓþªÑÈÀ´ÊµÏÖ£¬ÒòΪËäÈ»ÒÔÇ°ÎÒ×Ô¼º×ö¿ª·¢µÄʱºòÒ²»á¾³£Óõ½javascriptÀ´×öһЩ¶«Î÷£¬²¢ÇÒÒ²ÄÜʵÏÖËùÒªÐèÒªµÄ¹¦ÄÜ×ö£¬ÎÒûÓÐÏëµ½µÄÊÇ£¬ÆäÖÐÓõ½µÄһЩ¹¦ÄܾÓÈ»¿ÉÒÔÓúܼòµ¥µÄÓïÑÔ¾ÍÄÜʵÏÖ£¬²»À¢ÊǶàÄê×ܽáÏÂÀ´µÄ¾Ñ飡ÎÒÔÚÏëÈç¹ûÎÒÈÔ¾ÉÔÚÔÏȵĸÚλÉϼÌÐø×ö ......