Java³£ÓÃÕýÔò±í´ïʽ
java³£ÓÃÕýÔò±í´ïʽ
Ö»ÄÜÊäÈëÊý×Ö£º"^[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,}$"
ÑéÖ¤EmailµØÖ·£º"^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$"¡£
ÑéÖ¤InternetURL£º"^http://([\w-]+\.)+[\w-]+(/[\w-./?%&=]*)?$"¡£
ÑéÖ¤µç»°ºÅÂ룺"^(\(\d{3,4}-)|\d{3.4}-)?\d{7,8}$"ÕýÈ·¸ñʽΪ£º"XXX-XXXXXXX"¡¢"XXXX-XXXXXXXX"¡¢"XXX-XXXXXXX"¡¢"XXX-XXXXXXXX"¡¢"XXXXXXX"ºÍ"XXXXXXXX"¡£
ÑéÖ¤Éí·ÝÖ¤ºÅ£¨15λ»ò18λÊý×Ö£©£º"^\d{15}|\d{18}$"¡£
ÑéÖ¤Ò»ÄêµÄ12¸öÔ£º"^(0?[1-9]|1[0-2])$"ÕýÈ·¸ñʽΪ£º"01"¡«"09"ºÍ"1"¡«"12"¡£
ÑéÖ¤Ò»¸öÔµÄ31Ì죺"^((0?[1-9])|((1|2)[0-9])|30|31)$"ÕýÈ·¸ñʽΪ£»"01"¡«"09"ºÍ"1"¡«"31"¡£
Æ¥ÅäÖÐÎÄ×Ö·ûµÄÕýÔò±í´ïʽ£º
String.prototype.len=function(){return
this.replace(/[^\x00-\xff]/g,"aa").length;}
Æ¥Åä¿ÕÐеÄÕýÔò±í´ïʽ£º\n[\s| ]*\r
Æ
Ïà¹ØÎĵµ£º
1¡¢ÃæÏò¶ÔÏóµÄÌØÕ÷ÓÐÄÄЩ·½Ãæ
1.³éÏó£º
³éÏó¾ÍÊǺöÂÔÒ»¸öÖ÷ÌâÖÐÓ뵱ǰĿ±êÎ޹صÄÄÇЩ·½Ã棬ÒÔ±ã¸ü³ä·ÖµØ×¢ÒâÓ뵱ǰĿ±êÓйصķ½Ãæ¡£³éÏó²¢²»´òËãÁ˽âÈ«²¿ÎÊÌ⣬¶øÖ»ÊÇÑ¡ÔñÆäÖеÄÒ»²¿·Ö£¬ÔÝʱ²»Óò¿·Öϸ½Ú¡£³éÏó°üÀ¨Á½¸ö·½Ã棬һÊǹý³Ì³éÏ󣬶þÊÇÊý¾Ý³éÏó¡£
2.¼Ì³Ð£º
¼Ì³ÐÊÇÒ»ÖÖÁª½áÀàµÄ²ã´ÎÄ£ÐÍ£ ......
Properties props=System.getProperties(); //ϵͳÊôÐÔ
System.out.println("JavaµÄÔËÐл·¾³°æ±¾£º"+props.getProperty("java.version"));
System.out.println("JavaµÄÔËÐл·¾³¹©Ó¦ÉÌ£º"+props.getProperty("java.vendor"));
System.out ......
ÔÎÄ£ºhttp://zhaosoft.javaeye.com/blog/243586
Java
»ù±¾¸ÅÄ¼¯ºÏÀࣨCollection
£© List
/Set/Map µÄÇø±ðºÍÁªÏµ
Collection
£ºList
¡¢Set
Map£ºHashMap¡¢HashTable
ÈçºÎÔÚËüÃÇÖ®¼äÑ¡Ôñ
Ò»¡¢Array £¬ Arrays
Java
ËùÓГ´æ´¢¼°Ëæ»ú·ÃÎÊÒ»Á¬´®¶ÔÏó”µÄ×ö·¨£¬arrayÊÇ×îÓÐЧÂʵÄÒ»ÖÖ¡£
1¡¢ ......
ÔںܶàJavaÓ¦ÓÃÖÐÐèÒªÔÚ³ÌÐòÖе÷ÓÃJava±àÒëÆ÷À´±àÒëºÍÔËÐС£µ«ÔÚÔçÆڵİ汾ÖУ¨Java SE5¼°ÒÔÇ°°æ±¾£©ÖÐÖ»ÄÜͨ¹ýtools.jarÖеÄcom.sun.tools.javac°üÀ´µ÷ÓÃJava±àÒëÆ÷£¬µ«ÓÉÓÚtools.jar²»ÊDZê×¼µÄJava¿â£¬ÔÚʹÓÃʱ±ØÐëÒªÉèÖÃÕâ¸öjarµÄ·¾¶¡£¶øÔÚJava SE6ÖÐΪÎÒÃÇÌṩÁ˱ê×¼µÄ°üÀ´²Ù×÷Java±àÒëÆ÷£¬Õâ¾ÍÊÇjavax.tools°ü¡£Ê¹ÓÃÕ ......
½ñÌìÓöµ½ÁËÕâ¸öÎÊÌâ ÁËºÇºÇ ½â¾öÁ˸ø´ó¼Ò·ÖÏíÏÈ£¬java.lang.OutOfMemoryError: Java heap space ÒýÆðÁËÎÒÉÏ´«³ö´í¡£ÎÒ½â¾ö°ì·¨¾ÍÊÇ¿´ÄãʹÓõÄtomcat·þÎñÆ÷°æ±¾ÊÇʲôÑùµÄ£¬Èç¹ûÄãµÄtomcat/binϱßÓÐtomcatw.exe ¾Í·½±ãÁË£¬Ö±½Ó¿ÉÊÓ»¯²Ù×÷ŶÏÂÏÂͼ
ÆäÖÐÉèÖóõʼÄÚ´æ³ØºÍ×î´óÄÚ´æ³Ø£¬ÉèÖÃÔÔòÊǸù¾ÝÄãµÄÎïÀíÄÚ´æÀ´¶¨¡£
Èç¹û ......