package com.beicai.zhengze;
/*
* 正则表达式的替换功能
*/
public class TestReplaceAll {
public static void main(String[] args) {
// TODO Auto-generated method stub
String s = "Once1a22222wolf,3always4a5wolf!";
String regex = "\\d+";// \\d代表任意数字
String s2 = s.replaceAll(regex, " ");
System.out.println(s2);
}
}
/*
* 正则表达式的替换功能
*/
public class TestReplaceAll {
public static void main(String[] args) {
// TODO Auto-generated method stub
String s = "Once1a22222wolf,3always4a5wolf!";
String regex = "\\d+";// \\d代表任意数字
String s2 = s.replaceAll(regex, " ");
System.out.println(s2);
}
}