Pattern p = Pattern.compile("([\u4E00-\u9FA5]+)");
        Matcher m = p.matcher("[aa/]小米[/aa]");
        while(m.find()){
            System.out.println(m.group(1));
            
        }每次替换中间的"[aa/]小米[/aa]"即可

解决方案 »

  1.   

    Pattern p=Pattern.compile("(?<=\\]).*(?=\\[)");
    Matcher m=p.matcher("[aa/]小米AAA[/aa]");
    while(m.find()){
    System.out.println(m.group());
    }
      

  2.   

     Matcher m = Pattern.compile("\\[[a-z/]+\\](.*?)\\[[a-z/]+\\]").matcher("[aa/]小米[/aa]");
            while(m.find()){
               System.out.println(m.group(1));
            }
      

  3.   

    System.out.println("[aa/]小米[/aa]".replaceAll("\\[[a-z/]+\\](.*?)\\[[a-z/]+\\]", "$1"));
      

  4.   


     Matcher m = Pattern.compile("\\[([a-z]+)/\\].+?\\[/\\1\\]").matcher("[aa/]小米[/aa]");
            while(m.find()){
               System.out.println(m.group(2));
            }