求助,Java字符串分割问题

源代码:

 1 public class RegularExpressionDemo 
 2 {
 3     public static void main(String[] args) 
 4     {
 5         String text="abcdebcadxbc";
 6         String [] tokens=text.split(".bc");
 7         for(String token:tokens)
 8         {
 9             System.out.print(token+" ");
10         }
11         System.out.println();
12 
13         tokens=text.split("..cd");
14         for(String token:tokens)
15         {
16             System.out.print(token+" ");
17         }
18         System.out.println();
19     }
20 }

输出结果为:

d ad
ebcadxbc

问题:不知道原理是什么,为什么会有这样的结果?有高手看见的话指导一下,麻烦了!

posted @ 2012-04-16 17:28  json_chan  阅读(1474)  评论(5编辑  收藏  举报