有一段文本为
<div class="KonaBody" id="content">
<h1><a rel="book" title="Free eBook: Open Source Messaging Application Development Building and Extending Gaim" href="http://1ju.org/Open-Source-Messaging-Application-Development-Building-and-Extending-Gaim_288142.html">Open Source Messaging Application Development: Building and Extending Gaim</a></h1>
<h4>ISBN: 1590594673</h4>
<h4>Category: <a title="eBook Category: IT, Computer, Technology, Internet, Programming eBooks" href="http://1ju.org/tech.html">Technical</a></h4>
<h4>Tag: <a title="Tag: Programming" href="http://1ju.org/index.php?tag=5">Programming</a></h4>
<br>
<b><a rel="nofollow" href="http://www.babylon.com/redirects/download.cgi?type=100&amp;affID=15622">[Translate] Download Babylon Translation Software for Free!</a></b>
<br>
<!--<b><a href="http://1ju.org/buy/?title=Open%20Source%20Messaging%20Application%20Development%3A%20Building%20and%20Extending%20Gaim" title="Buy Book:Open Source Messaging Application Development: Building and Extending Gaim" target="_blank" rel="nofollow">&lt;&lt; Buy This Book for Lowest Price &gt;&gt;</a></b>
<br /><br />-->
Posted on 2009-05-29. The poster is not available. <a rel="nofollow" target="_blank" href="http://www.addthis.com/book.php?v=1&amp;pub=ebookee&amp;url=http://1ju.org/Open-Source-Messaging-Application-Development-Building-and-Extending-Gaim_288142.html&amp;title=Open+Source+Messaging+Application+Development%3A+Building+and+Extending+Gaim++%7C+Free+eBooks+Download+-+EBOOKEE%21"><img height="16" width="125" border="0" alt="Book this: Open Source Messaging Application Development Building and Extending Gaim" src="img/button1-bm.gif"></a>
<div class="clearline"></div>
<hr><a name="description"></a>
<div class="tag5" id="description">
<h3>Description</h3>
<div class="float-left" id="ad_content_start">
<input type="hidden" value="1" name="IL_RELATED_TAGS" id="IL_RELATED_TAGS1">
</div><br>
<div class="center"><div class="image"><a target="_blank" href="/go/?u=http://gigaimg.com/images/124861"><img alt="Open Source Messaging Application Development" src="http://books.gigaimg.com/avaxhome/80/32/000d3280_medium.jpeg"></a></div><br> <b>Sean Egan, «Open Source Messaging Application Development: Building and Extending Gaim»</b><br> Apress | ISBN: <a asin="1590594673" type="amzn" target="_blank" href="/go/?u=">1590594673</a> | 2006 | PDF | 392 pages | 18.59 MB</div><br> I discovered Gaim in the AOL <span id="IL_AD6" class="IL_AD">Instant Messenger</span> (AIM) user <span id="IL_AD11" class="IL_AD">profile</span> of a friend about five years ago. I didn’t know a lot about Linux then. I knew that it was a free implementation of UNIX with publicly available <span id="IL_AD2" class="IL_AD">source code</span>, but my <span id="IL_AD7" class="IL_AD">previous</span> experiences with UNIX comprised staring at a shell prompt, trying to type cryptic commands into a “DOS-like” console. Likewise, I assumed that Linux was primitive compared to the high-tech, state-of-the-art Windows 98 I was using<br> that day when I read my friend’s profile.<br> <br> <a target="_blank" href="/go/?u=http://depositfiles.com/files/ofjugxalh"><div class="center"><b><u>download</u></b></div></a><br> <a target="_blank" href="/go/?u=http://www.megaupload.com/?d=K2YXDAQP"><div class="center"><b><u>mirror</u></b></div></a><br> <br> <a target="_blank" href="/go/?u=http://1ju.org/"><div class="center"><b><u><span class="">My blog on AH</span></u></b></div></a><br> <div class="center"><b>No mirrors, please</b></div><br>
</div><!-- description -->
<center><b><a target="_blank" rel="nofollow" href="/download/?file=Open+Source+Messaging+Application+Development%3A+Building+and+Extending+Gaim">[Directly Download] Open Source Messaging Application Development: Building and Extending Gaim!</a></b></center>
<br>
<div class="font-bold codetop">Download this book from <span id="IL_AD4" class="IL_AD">Usenet</span></div>
<div class="codemain">
<a rel="nofollow" href="http://1ju.org/download/?file=Open+Source+Messaging+Application+Development%3A+Building+and+Extending+Gaim"><img align="left" alt="DOWNLOAD" src="/img/down_green.png"></a>
Free register and download UseNet downloader, then you can <span id="IL_AD1" class="IL_AD">free download</span> from UseNet. You can download 150GB ebooks, audiobooks and anything for FREE.<br><br>
<a rel="nofollow" target="_blank" title="UseNeXT: free unique usenet client" href="http://1ju.org/download/?file=Open+Source+Messaging+Application+Development%3A+Building+and+Extending+Gaim"><b>Free Download "Open Source Messaging Application Development: Building and Extending Gaim" from Usenet!</b></a><br>
</div>
<br>
<!--<div class="font-bold codetop">Buy this book at the best price</div>
<div class="codemain">
<b><a href="http://1ju.org/buy/?title=Open%20Source%20Messaging%20Application%20Development%3A%20Building%20and%20Extending%20Gaim" title="Buy Book:Open Source Messaging Application Development Building and Extending Gaim" target="_blank" rel="nofollow">$$ Buy "Open Source Messaging Application Development: Building and Extending Gaim" at BEST Price $$</a></b>
</div>
<br />-->
</div></div>
怎么提出去时间字符串, 也就是2009-05-29

解决方案 »

  1.   

    用正则表达式String str = "<!--<b><a href=\"http://1ju.org/buy/?title=Open%20Source%20Messaging%20Application%20Development%3A%20Building%20and%20Extending%20Gaim\" title=\"Buy Book:Open Source Messaging Application Development: Building and Extending Gaim\" target=\"_blank\" rel=\"nofollow\">&lt;&lt; Buy This Book for Lowest Price &gt;&gt;</a></b>\n<br /><br />-->\nPosted on 2009-05-29. The poster is not available. <a rel=\"nofollow\" target=\"_blank\" href=\"http://www.addthis.com/book.php?v=1&amp;pub=ebookee&amp;url=http://1ju.org/Open-Source-Messaging-Application-Development-Building-and-Extending-Gaim_288142.html&amp;title=Open+Source+Messaging+Application+Development%3A+Building+and+Extending+Gaim++%7C+Free+eBooks+Download+-+EBOOKEE%21\"><img height=\"16\" width=\"125\" border=\"0\" alt=\"Book this: Open Source Messaging Application Development Building and Extending Gaim\" src=\"img/button1-bm.gif\"></a>\n<div class=\"clearline\"></div>";
    String regExp = "\\d{4}-\\d{1,2}-\\d{1,2}";
    Matcher m=Pattern.compile(regExp).matcher(str);
    if (m.find()) System.out.println(m.group(0));
      

  2.   

    int wz=0;//出现数字的位置
    if(str[wz]>='0'&&str[wz]<='9'&&str[wz+4]=='-'&&str[wz+7]=='-')
    输出。
      

  3.   

    正则表达式分组:"\s(\d{4}-\d{2}-\d{2})\s"