62,614
社区成员
发帖
与我相关
我的任务
分享
public static void main(String[] args) throws Exception {
String s = "SRC : url ( \"ZNJK_Basma.ttf\");";
s = s.replaceAll("((?i)src\\s*:\\s*(?i)url)\\s*\\(.+?\\);", "$1(\"myfont.ttf\");");
System.out.println(s);
}
public class Test {
public static void main(String[] args) {
String text = "@font-face {" + "font-family: UKK_Basma;"
+ "font-style: normal;" + "font-weight: normal;"
+ "src: url(\"ZNJK_Basma.ttf\");" + "}";
text = text.replaceAll("src: url(.+);", "src: url(\"myfont.ttf\");");
System.out.println(text);
}
}