Regexp grouping and replaceAll with .* in Java duplicates the replacement

前端 未结 3 2016
故里飘歌
故里飘歌 2021-01-18 17:28

I got a problem using Rexexp in Java. The example code writes out ABC_012_suffix_suffix, I was expecting it to output ABC_012_suffix



        
3条回答
  •  执笔经年
    2021-01-18 17:40

    If you just want to add "_suffix" to your input why don't you just do:

    String result = "ABC_012" + "_suffix";
    

    ?

提交回复
热议问题