phoenix13

导航

 

1. regex with variable

example: find the number and put a parenthese around the number.

output: 

a(5265)b

String field = "a5265b";
String result = field.replaceAll("(\\d+)", "($1)");

 

posted on 2016-05-13 14:34  phoenix13  阅读(112)  评论(0编辑  收藏  举报