Pattern p = Pattern.compile("[\u4e00-\u9fa5]"); 
     Matcher m = p.matcher("AA中C国(中国)(人BB"); 
         while (m.find()) { 
                                System.out.println(s0); 
                        } 
现在输出 中国中国人我想输出中国(中国)(人 要怎样改正则表达式

解决方案 »

  1.   

    Pattern p = Pattern.compile("[\u4e00-\u9fa5()]");
    Matcher m = p.matcher("AA中C国(中国)(人BB");
    while (m.find()) {
    System.out.print(m.group());
    }
      

  2.   

    Pattern p = Pattern.compile("[\u4e00-\u9fa5()]");
    Matcher m = p.matcher("A(A中C国(中国)(人BB");
     while (m.find()) {
     System.out.print(m.group());
     } 
      

  3.   

    Pattern p = Pattern.compile("[\u4e00-\u9fa5()]");
          Matcher m = p.matcher("A(A)中C国(中国)(人BB");
           while (m.find()) {
           System.out.print(m.group());
           }  
      这样就错啦。。
      

  4.   

    我要中文 OR (中文   (E 不要