从 [[text]] 获取值的正则表达式。我试过正则表达式
"((?<=[[)*(?=]])*)+" the value between [[ ]] is not obtained.
例如,从字符串 [[text]] 中,我们应该获取文本。
Pattern pat = Pattern.compile("((?<=\\[[)*(?=\\]])*)");
Matcher matcher = pat.matcher("[[text]]");
String next ="";
while(matcher.find()) {
next = matcher.group(0);
break;
}
System.out.println(next); //next should be text