正则表达式截取字符串问题 多组字符串都是由若干个字符+abc.+若干个字符+xyz.+若干个字符组成,问用正则表达式如何取出abc.和xyz.中间那段字符串? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用String类中的spilt,简单实用啊 import java.util.regex.Matcher;import java.util.regex.Pattern;public class Test { private static String temp = "It's aabc. demoxyz.!!!"; public static void main(String[] s) { Pattern p = Pattern.compile(".*abc\\.(.*)xyz\\..*"); Matcher m = p.matcher(Test.temp); if(m.find()) { System.out.println(m.group(1)); } } } #2楼 得分:0回复于:2010-02-14 16:39:34import java.util.regex.Matcher; import java.util.regex.Pattern; public class Test { private static String temp = "It's aabc. demoxyz.!!!"; public static void main(String[] s) { Pattern p = Pattern.compile(".*abc\\.(.*)xyz\\..*"); Matcher m = p.matcher(Test.temp); if(m.find()) { System.out.println(m.group(1)); } } } java的泛型参数问题 简易的IDE 我安装了jdk-1_5_0_04-nb-4_1-win.exe ,为何在 安装的bin 目录下找不以javac.exe 呢? MyEclipse 如何用最简单的方法把Object[]转化为String[]? 谁能帮忙解释一下垃圾回收的概念(有代码) 菜鸟提问: 在JAVA中判断一JTextField 的输入值有几种办法??谢谢!! 如何中止线程?? 各位大虾来看看这是什么原因 几个怪问题,也是小问题!求助!!! 一些面试题求准确答案 java 远程调用rmi 传输文件 简单问题
import java.util.regex.Pattern;public class Test { private static String temp = "It's aabc. demoxyz.!!!";
public static void main(String[] s)
{
Pattern p = Pattern.compile(".*abc\\.(.*)xyz\\..*");
Matcher m = p.matcher(Test.temp);
if(m.find())
{
System.out.println(m.group(1));
}
}
}
#2楼 得分:0回复于:2010-02-14 16:39:34import java.util.regex.Matcher;
import java.util.regex.Pattern; public class Test { private static String temp = "It's aabc. demoxyz.!!!"; public static void main(String[] s)
{
Pattern p = Pattern.compile(".*abc\\.(.*)xyz\\..*");
Matcher m = p.matcher(Test.temp);
if(m.find())
{
System.out.println(m.group(1));
}
}
}