删除圆括号我有一个字符串正则表达式从字符串
String s="[[Identity (philosophy)|unique identity]]";
我需要将其解析到。
s1 = Identity_philosphy
s2= unique identity
我曾尝试下面的代码
Pattern p = Pattern.compile("(\\[\\[)(\\w*?\\s\\(\\w*?\\))(\\s*[|])\\w*(\\]\\])");
Matcher m = p.matcher(s);
while(m.find())
{
....
}
但是这种模式并不匹配..
请帮助
感谢
你需要插入那里曾经是括号中的下划线?如果是这样,这样做的具体规则是什么? –