1 import java.util.regex.Matcher;
2 import java.util.regex.Pattern;
3 public class RegexDemo {
4 public static void main(String[] args) {
5 String str="A1B22C333D4444E55555";
6 String pat="\\d+";
7 Pattern p=Pattern.compile(pat);
8 Matcher m=p.matcher(str);
9 String newS=m.replaceAll("_");
10 System.out.print(newS);
11 }
12 }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-16
  • 2021-07-22
  • 2022-12-23
  • 2022-12-23
  • 2022-01-27
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-09
  • 2022-12-23
  • 2021-11-01
  • 2022-01-18
  • 2022-12-23
相关资源
相似解决方案