import java.util.regex.*;
String INPUT = "I am accepted by the school";
String REPLACE = "$1z";
Pattern p = Pattern.compile("\\b(a\\S*)\\S\\b");
String s = p.matcher(INPUT).replaceAll(REPLACE);
System.out.println(s.toString());
String INPUT = "I am accepted by the school";
String REPLACE = "$1z";
Pattern p = Pattern.compile("\\b(a\\S*)\\S\\b");
String s = p.matcher(INPUT).replaceAll(REPLACE);
System.out.println(s.toString());
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货