解决方案 »

  1.   


    final String REGEX=".*(\\(.*\\))Copyright.*";
    String str1="Platform SoftwareVRP (R) software, Version 8.100 (CE6850EI V100R005C10)Copyright (C) 2012-2015  Technologies Co., Ltd.HUAWEI CE6";
    Matcher m=Pattern.compile(REGEX, Pattern.CASE_INSENSITIVE).matcher(str1);
    if(m.find()){
    System.out.println(m.group(1).replace("(", "").replace(")", ""));
    }
      

  2.   

    Matcher m=Pattern.compile(".*?\\).*?\\(([^)]*?)\\)").matcher(s);
    if(m.find())System.out.println(m.group(1)); 
      

  3.   

    好多写法啊,来个最笨的
    Pattern pattern = Pattern.compile("Version 8.100\\s+\\((.*)\\)Copyright");   
    Matcher matcher = pattern.matcher(s); 
    StringBuffer sbr = new StringBuffer();   
    if (matcher.find()) {   
      System.out.println(matcher.group(1));   
      

  4.   

    String str1="Platform SoftwareVRP (R) software, Version 8.100 (CE6850EI V100R005C10)Copyright (C) 2012-2015  Technologies Co., Ltd.HUAWEI CE6";
            int i = str1.indexOf("(",str1.indexOf("(")+1);
            int j = str1.indexOf(")",str1.indexOf(")")+1);
            String str2 = str1.substring(i+1,j);
            System.out.println(str2);
      

  5.   


    import org.apache.commons.lang.StringUtils;String[] arr = StringUtils.substringsBetween(testStr, "(", ")");
    System.out.println(arr[1]);//第二个