Pattern和Matcher中表达式

//使用正则表达式
//Pattern pattern = Pattern.compile("[^\u4E00-\u9FA5]");//[\u4E00-\u9FA5]是unicode2的中文区间
Pattern pattern = Pattern.compile("用户");
Matcher matcher = pattern.matcher("用户15454");
String str = "搬运工"+"-"+matcher.replaceAll("");
System.out.println(str);
posted @ 2018-03-09 12:01  ForgotTheMemory  阅读(293)  评论(0编辑  收藏  举报