50,523
社区成员
发帖
与我相关
我的任务
分享
String s = "/行政类@行政1#行政2/人事类@人事1#人事2/财务类@财务1#财务2/采购类/生产类/技术类/市场类/售后类/物流类/其他";
Pattern p = Pattern.compile("/([\\w\\u4e00-\\u9fa5]+)");
Matcher m = p.matcher(s);
while(m.find()) {
System.out.println(m.group(1));
}
Pattern p1 = Pattern.compile("@([\\w\\u4e00-\\u9fa5]+)");
Matcher m1 = p1.matcher(s);
while(m1.find()) {
System.out.println(m1.group(1));
}
Pattern p2 = Pattern.compile("#([\\w\\u4e00-\\u9fa5]+)");
Matcher m2 = p2.matcher(s);
while(m2.find()) {
System.out.println(m2.group(1));
}
String s = "/行政类@行政1#行政2/人事类@人事1#人事2/财务类@财务1#财务2/采购类/生产类/技术类/市场类/售后类/物流类/其他";
Pattern p = Pattern.compile("/[\\w\\u4e00-\\u9fa5]+");
Matcher m = p.matcher(s);
while(m.find()) {
System.out.println(m.group(0));
}
Pattern p1 = Pattern.compile("@[\\w\\u4e00-\\u9fa5]+");
Matcher m1 = p1.matcher(s);
while(m1.find()) {
System.out.println(m1.group(0));
}
Pattern p2 = Pattern.compile("#[\\w\\u4e00-\\u9fa5]+");
Matcher m2 = p2.matcher(s);
while(m2.find()) {
System.out.println(m2.group(0));
}