public class TestString {
public static void main(String args[]) {
String str="For my money, the important thing about the meeting was bridge- buildingf";
String regEx="a*f";
Pattern p=Pattern.compile(regEx);
Matcher m=p.matcher(str);
System.out.println(m.replaceAll("1"));
}
}
问:我如何找到上述字符串,以a标记开始,f标记结束的子,a,f之间是任意字符的子串
public static void main(String args[]) {
String str="For my money, the important thing about the meeting was bridge- buildingf";
String regEx="a*f";
Pattern p=Pattern.compile(regEx);
Matcher m=p.matcher(str);
System.out.println(m.replaceAll("1"));
}
}
问:我如何找到上述字符串,以a标记开始,f标记结束的子,a,f之间是任意字符的子串