62,615
社区成员
发帖
与我相关
我的任务
分享
Pattern pat = Pattern.compile("/(.+?)@");
Matcher mat = pat.matcher("xxxxx/yyyyy@zzzzzz ");
while (mat.find()) {
System.out.println(mat.group(1));
}
String str = "xxxx/yyyyy@zzzzzz";
String regex = "\\/.*?\\@";
Pattern p = Pattern.compile(regex);
Matcher m = p.matcher(str);
while(m.find())
{
System.out.println(str.substring(m.start() + 1, m.end() - 1));
}
String str = "xxxx/yyyyy@zzzzzz";
String regex = "\\/|\\@";
String[] strs = str.split(regex);
for(String s: strs)
{
System.out.println(s);
}