帮我写一个正则表达式取 第二个 圆括号中的值把,急求! 正则表达式string正则java 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 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(")", "")); } Matcher m=Pattern.compile(".*?\\).*?\\(([^)]*?)\\)").matcher(s);if(m.find())System.out.println(m.group(1)); 好多写法啊,来个最笨的 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)); 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); import org.apache.commons.lang.StringUtils;String[] arr = StringUtils.substringsBetween(testStr, "(", ")");System.out.println(arr[1]);//第二个 spring用处不大啊,为什么这么流行? Javamail发邮件,yahoo邮箱收到后出现附件乱码问题。 关于jdbc问题 网络摄像头编程 初级问题 配置问题+helloworld 程序全部过程 一个弱智的问题 使用Uploadbean上传文件进数据库的问题 struts-menu的target问题 如何用jsp做出那种搜索引擎的那种分页搜索啊 急!关于如何在jsp页面里使用JavaBean里的方法的问题 ! 试用期新人请各位大神帮忙指点(extjs grid) java接收到的邮件有内嵌图片,请问怎么把内嵌图片显示到网页上面
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(")", ""));
}
if(m.find())System.out.println(m.group(1));
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));
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);
import org.apache.commons.lang.StringUtils;String[] arr = StringUtils.substringsBetween(testStr, "(", ")");
System.out.println(arr[1]);//第二个