ÊÕ¼¯µ½µÄjava ÕýÔòÑéÖ¤
Java´úÂ룺
import java.util.regex.*;
public final class RegExpValidator
{
/**
* ÑéÖ¤ÓÊÏä
* @param ´ýÑéÖ¤µÄ×Ö·û´®
* @return Èç¹ûÊÇ·ûºÏµÄ×Ö·û´®,·µ»Ø <b>true </b>,·ñÔòΪ <b>false </b>
*/
public static boolean isEmail(String str)
{
String regex = "^([\\w-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$";
return match(regex, str);
}
/**
* ÑéÖ¤IPµØÖ·
* @param ´ýÑéÖ¤µÄ×Ö·û´®
* @return Èç¹ûÊÇ·ûºÏ¸ñʽµÄ×Ö·û´®,·µ»Ø <b>true </b>,·ñÔòΪ <b>false </b>
*/
public static boolean isIP(String str)
{
String num = "(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)";
String regex = "^" + num + "\\." + num + "\\." + num + "\\." + num + "$";
return match(regex, str);
}
/**
* ÑéÖ¤ÍøÖ·Url
* @param ´ýÑéÖ¤µÄ×Ö·û´®
* @return Èç¹ûÊÇ·ûºÏ¸ñʽµÄ×Ö·û´®,·µ»Ø <b>true </b>,·ñÔòΪ <b>false </b>
*/
public static boolean IsUrl(String str)
{
String regex = "http(s)?://([\\w-]+\\.)+[\\w-]+(/[\\w- ./?%&=]*)?";
return match(regex, str);
}
/**
* ÑéÖ¤µç»°ºÅÂë
* @param ´ýÑéÖ¤µÄ×Ö·û´®
* @return Èç¹ûÊÇ·ûºÏ¸ñʽµÄ×Ö·û´®,·µ»Ø <b>true </b>,·ñÔòΪ <b>false </b>
*/
public static boolean IsTelephone(String str)
{
String regex = "^(\\d{3,4}-)?\\d{6,8}$";
return match(regex, str);
}
/**
* ÑéÖ¤ÊäÈëÃÜÂëÌõ¼þ(×Ö·ûÓëÊý¾Ýͬʱ³öÏÖ)
* @param ´ýÑéÖ¤µÄ×Ö·û´®
* @return Èç¹ûÊÇ·ûºÏ¸ñʽµÄ×Ö·û´®,·µ»Ø <b>true </b>,·ñÔòΪ <b>false </b>
*/
public static boolean IsPassword(String str)
{
String regex = "[A-Za-z]+[0-9]";
return match(regex, str);
}
/**
* ÑéÖ¤ÊäÈëÃÜÂ볤¶È (6-18λ)
* @param ´ýÑéÖ¤µÄ×Ö·û´®
* @return Èç¹ûÊÇ
Ïà¹ØÎĵµ£º
Ò»¡¢±³¾°
1¡¢µ±ÎÒÃǵÚÒ»´Î½Ó´¥Ä³¶Î´úÂ룬µ«ÓÖ±»ÒªÇóÔÚ¼«¶ÌµÄʱ¼äÄÚÓÐЧµØ·ÖÎöÕâ¶Î´úÂ룬ÎÒÃÇÐèҪʲôÑùµÄ×¢ÊÍÐÅÏ¢£¿
2¡¢ÔõôÑù±ÜÃâÎÒÃǵÄ×¢ÊÍÈß³¤¶øÇÒÁèÂÒ²»¿°ÄØ£¿
3¡¢ÔÚ¶àÈËÐͬ¿ª·¢¡¢Î¬»¤µÄ½ñÌ죬ÎÒÃÇÐèÒªÔõôÑùµÄ×¢ÊÍÀ´±£Ö¤¸ßÖÊ¡¢¸ß½»µÄ½øÐпª·¢ºÍά»¤¹¤×÷ÄØ£¿
¶þ¡¢ÒâÒå
³ÌÐòÖеÄ×¢ÊÍÊdzÌÐòÉè¼ÆÕßÓë³ÌÐòÔĶÁÕß ......
java byteÓëchar»¥×ªÔÀí-ת
Ò»¡¢×Ö½ÚºÍunicode
JavaÄÚºËÊÇunicodeµÄ£¬¾ÍÁ¬classÎļþÒ²ÊÇ£¬µ«ÊǺܶàýÌ壬°üÀ¨Îļþ/Á÷µÄ±£´æ·½Ê½ÊÇʹÓÃ×Ö½ÚÁ÷µÄ¡£Òò´ËJavaÒª¶ÔÕâЩ×Ö½ÚÁ÷¾ÐÐת»¯¡£ charÊÇunicodeµÄ£¬¶øbyteÊÇ×Ö½Ú¡£JavaÖÐ byte/char»¥×ªµÄº¯ÊýÔÚsun.ioµÄ°üÖмäÓС£ÆäÖÐByteToCharConverterÀàÊÇÖе÷¶È£¬¿ÉÒÔÓÃÀ´¸æËßÄ㣬 ......
JavaÓïÑÔµÄÊäÈëÊä³ö¹¦ÄÜÊÇÊ®·ÖÇ¿´ó¶øÁé»îµÄ£¬ÃÀÖв»×ãµÄÊÇ¿´ÉÏÈ¥ÊäÈëÊä³öµÄ´úÂë²¢²»ÊǺܼò½à£¬ÒòΪÄãÍùÍùÐèÒª°ü×°Ðí¶à²»Í¬µÄ¶ÔÏó¡£ÔÚJavaÀà¿âÖУ¬IO²¿·ÖµÄÄÚÈÝÊǺÜÅÓ´óµÄ£¬ÒòΪËüÉæ¼°µÄÁìÓòºÜ¹ã·º:±ê×¼ÊäÈëÊä³ö£¬ÎļþµÄ²Ù×÷£¬ÍøÂçÉϵÄÊý¾ÝÁ÷£¬×Ö·û´®Á÷£¬¶ÔÏóÁ÷£¬zipÎļþÁ÷....±¾ÎĵÄÄ¿µÄÊÇΪ´ó¼Ò×öÒ»¸ö¼òÒªµÄ½éÉÜ¡£
¡¡¡¡Á ......
ÔÚjavaÖÐÃ²ËÆ²»ÄÜͬʱ´´½¨Ä¿Â¼ºÍÎļþ£¬ÐèÒª·Ö²¼´´½¨£¬¼´²»ÄÜÔÚ´´½¨Ä¿Â¼µÄʱºò£¬Í¬Ê±´´½¨¸ÃĿ¼ÏµÄÎļþ£¬Èç¹ûÒª´´½¨µÄ»°£¬ÐèÒª·ÖÁ½²½£¬Ï±ßÊÇ´´½¨µÄ´úÂëJava´úÂë try { String path = "D:/test ......
ת×Ô£ºIBM¼¼ÊõÉçÇø2009 Java ×¨Çø×îÊÜ»¶ÓÄÚÈÝ
×îÊÜ»¶ÓµÄÈÈÃÅÖ÷Ìâ
Web ¿ª·¢
2009
Ä꣬Web 2.0 Èȳ±´Ùʹ Web ¿ª·¢¼ÌÐø³ÉΪµ±Ç°×îÈÈÃŵÄÖ÷Ìâ¡£ÆäÖУ¬»ùÓÚ¶¯Ì¬ÓïÑÔ Goovy µÄÐÂÐË Web ¿ª·¢¿ò¼Ü Grails
³ÉΪÁ˱¸ÊÜÖõÄ¿µÄÐÂÐÇ¡£³ý´ËÖ®Í⣬Ðí¶à´«Í³µÄ»ùÓÚ Java ÓïÑ﵀ Web ¿ª·¢¿ò¼Ü£¬Èç Struts¡¢JSF¡¢GWT
µÈ£¬Ò²¶¼ÈÚÈë ......