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.¼Ì³Ð£º
¼Ì³ÐÊÇÒ»ÖÖÁª½áÀàµÄ²ã´ÎÄ£ÐÍ£ ......
MineHeÔ´´
¿´ÁËһ϶ÔJava GUIÌÖÂÛµÄÌû×Ó£¬ËùÒÔдÁËһƪÎÄÕÂÀ´²ûÊöһϸ÷ÖÖGUI¼¼ÊõµÄÓÅÁÓ¡£
JavaÊÀ½çÖУ¬Ä¿Ç°×îÖªÃûµÄÈý´óGUI¿â·Ö±ðÊÇ£º
1¡¢AWT£¨Abstract Window Toolkit£©³éÏó´°¿Ú¹¤¾ß°ü¿â£¬°üº¬ÓÚËùÓеÄJava SDKÖÐ
2¡¢Swing¸ß¼¶Í¼Ðο⣬°üº¬ÓÚJava2 SDKÖÐ
3¡¢À´×ÔIBM Eclipse¿ªÔ´ÏîÄ¿µÄSWT£¨Standard Widget Toolk ......
´ó¼Ò¶¼ËµjavaʹÓõÄ×Ö·û¼¯ÊÇunicode£¬ÄÇôĬÈϱàÂë²»¾ÍÊÇÓ¦¸ÃÊÇUTF8,UTF16Ö®ÀàµÄunicode±àÂëÂð£¿
¿ÉÊǵ÷ÓÃCharset.defaultCharset()µÄ½á¹û²¢·ÇÈç´Ë¡£
import java.nio.charset.Charset;
public class javaCode {
public static void main(String args[])
{
String defaultCharsetName=Charset.defaultChars ......
ÔÎĵØÖ·:http://www.javaeye.com/topic/477731
°æȨÉùÃ÷£ºËùÓаæȨ¹éÔ×÷ÕßËùÓÐ
ö¾ÙÀàÐÍÊÇJDK5.0µÄÐÂÌØÕ÷¡£SunÒý½øÁËÒ»¸öȫеĹؼü×ÖenumÀ´¶¨ÒåÒ»¸öö¾ÙÀà¡£ÏÂÃæ¾ÍÊÇÒ»¸öµäÐÍö¾ÙÀàÐ͵Ķ¨Ò壺
Java´úÂë
public enum Color{
RED,BLUE,BLACK,YELLOW,GREEN &nb ......
Ò»¡¢JavaÖе÷ÓÃservlet˵Ã÷£º
ÎÒÃÇÓÐʱ¿ÉÄÜÐèÒªÔÚJavaÀàÖе÷ÓÃServlet´Ó¶øʵÏÖijЩÌØÊâµÄ¹¦ÄÜ£¬ÔÚJavaAPIÖÐÌṩÁËÒ»¸öURLµÄÀ࣬ÆäÖÐopenStream( )·½·¨¿ÉÒÔ´ò¿ªURLµÄÁ¬½Ó£¬²¢·µ»ØÒ»¸öÓÃÓÚ¸ÃÁ¬½Ó¶ÁÈëµÄInputStream¡£
¶þ¡¢JavaÖе÷ÓÃservletÓ¦ÓþÙÀý£º
package com.solid.test;
import java.io.BufferedReader;
import ja ......