JAVAÖÐÕýÔò±í´ïʽµÄÓ¦ÓÃ2
public static void main(String[] args)
{
InputStream is = CommonUtil.getStream("http://wz.csdn.net/");
String regex = "(?<=href=\")[^\"]*";//²éÕÒÍøÒ³ÖÐËùÓÐÁ¬½Ó×Ö·û´®
// String regex2 = "[A-Za-z]*([\u4e00-\u9fa5]*)(?=\\d*(\\.\\d*)*)";
String test="<td><a rel=\"mz\" href=\"http://bbs.csdn.net/\">ÂÛ̳</a></td>";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(test);
//ÏÔʾƥÅäÉϵÄ×Ö·û´®¡£Ò»´ÎÖ»ÕÒÆ¥ÅäµÄÒ»¸ö£¬±ØÐëÑ»·ÕÒ³öËùÓÐ
while(matcher.find())
{
System.out.println(matcher.group());
}
System.out.println(CommonUtil.patternText(test,regex));
System.out.println(CommonUtil.replaceRegex(test,regex,""));
}
/**
* ¸ù¾ÝÖ¸¶¨µÄÕýÔò±í´ïʽÑéÖ¤Ö¸¶¨µÄÎı¾ÄÚÈÝ
* @param content
* @return
* @throws UnsupportedEncodingException
*/
public static boolean patternText(String text,String regex)
{
// Pattern pattern=Pattern.compile("[A-Za-z]*([\u4e00-\u9fa5]*)(?=\\d*(\\.\\d*)*)");
Pattern pattern = Pattern.compile(regex);
Matcher matcher = patt
Ïà¹ØÎĵµ£º
1¡¢ ¶ÔÏóµÄ³õʼ»¯
(1) ·Ç¾²Ì¬¶ÔÏóµÄ³õʼ»¯
ÔÚ´´½¨¶ÔÏóʱ£¬¶ÔÏóËùÔÚÀàµÄËùÓÐÊý¾Ý³ÉÔ±»áÊ×ÏȽøÐгõʼ»¯¡£
»ù±¾ÀàÐÍ£ºintÐÍ£¬³õʼ»¯Îª0¡£
Èç¹ûΪ¶ÔÏó£ºÕâЩ¶ÔÏó»á°´Ë³Ðò³õʼ»¯¡£
¡ùÔÚËùÓÐÀà³ÉÔ±³õʼ»¯Íê³ÉÖ®ºó£¬²Åµ÷Óñ¾ÀàµÄ¹¹Ôì·½·¨´´½¨¶ÔÏó¡£
¹¹Ôì·½·¨µ ......
¶ÔÓÚXml,ÎÒµÄÈÏʶÊÇ,Ò»¸öÓÃÀ´´æ·ÅÊý¾ÝµÄ±ê×¼¸ñʽ.Ôõô¿´ÎÒ¶¼¾õµÃXMLºÍHtml,ÍêÈ«²»Ò»Ñù,Ò²Ðí½ö½öÖ»ÊǶ¼Ê¹ÓÃÁ˱ê¼ÇÀ´×÷ΪÎĵµ½âÊ͵ÄÔÒò°É.ËùÒÔÈËÃDzÅϲ»¶°ÑXMLºÍHTML¶Ô±ÈÀ´¿´.¶ÔÓÚÎÒ¸öÈ˶øÑÔ,XML¾ÍÊÇÒ»¸ö¼òµ¥·½±ãµÄÊý¾ÝÎļþ.ÒòΪ.Ëü²»Í¬ÓëÒ»°ãµÄ¹ØϵÐÍÊý¾Ý¿â,°ÑÊý¾Ý¿´³ö¶þά±í.ͨ¹ý»ù±¾µÄ¹ØϵÔËËã,»ñÈ¡¶þά±íÖеÄÊý ......
ʵÏÖÒ»¸öRMIÓ¦ÓóÌÐò£¨ÊµÑ鱨¸æ£©
¢åʵÑéÄÚÈÝ
ʵÏÖÒ»¸ö¼òµ¥µÄʵʱÁÄÌìϵͳ¡£
¢æ´¦ÀíÁ÷³Ì
1¡¢ÏµÍ³Éè¼Æ
¢Ù ´´½¨»Øµ÷½Ó¿Ú
¶¨ÒåÒ»¸ö»Øµ÷½Ó¿Ú£¬·þÎñÆ÷¶Ë¿ÉÒԻص÷´Ë½Ó¿ÚÖÐÉùÃ÷µÄ·½·¨¡£¸Ã½Ó¿Ú±ØÐë¼Ì³ÐÔ¶³Ì½Ó¿Ú¼´Remote¡£
¢Ú ´´½¨Ò»¸ö±¾µØ½Ó¿Ú
ÔڸýӿÚÖÐÌí¼Ó±¾½Ó¿ÚµÄʵÏÖÀàÖÐµÄ ......
java.version Java Runtime Environment version
java.vendor Java Runtime Environment vendor
java.vendor.url   ......
תÖÁ£ºhttp://sllereak.blog.163.com/blog
--ʲôÊÇÏß³Ì
*Ïß³ÌÊÇÒ»¸ö³ÌÐòÀïÃ治ͬµÄÖ´Ðз¾¶
*³ÌÐòÖ´ÐÐÔÚͬһʱ¼äÀïÃ棬ÿһ¸öÖ´ÐеķÖÖ§¾ÍÊÇÒ»¸öÏß³Ì
*Ò»¸ö³ÌÐòµÄMain()·½·¨ÖеÄÖ´ÐÐÏß·³ÆΪ³ÌÐòµÄÖ÷Ïß³Ì
--½ø³ÌºÍÏß³Ì
*½ø³ÌÊÇÒ»¸ö¾²Ì¬µÄ¸ÅÄµ±´úÂë±»javaÐéÄâ»ú¼ÓÔص½code segmentÖ ......