Pattern regexp = Pattern.compile(".*");
Matcher matcher = regexp.matcher("ABC_012");
matcher.matches();
System.out.println(matcher.group(0));
System.out.println(matcher.replaceAll("$0_suffix"));
:
ABC_012
ABC_012_suffix_suffix
replaceAll: find , :
while (matcher.find()) {
System.out.printf("Start: %s, End: %s%n", matcher.start(), matcher.end());
}
:
Start: 0, End: 7
Start: 7, End: 7
, , "ABC_012" "". "_suffix" :
"ABC_012" + "_suffix" + "" + "_suffix"