如何从此代码中删除一些文字 http://pastebin.com/09N1GzdR并且只在第一个和最后一个Structure标记之间留下文字?我尝试将replaceAll与正则表达式一起使用,如:
<transform>
<simple>${body.replaceAll("<Structure>([^]*)<\/Structure>", "")}</simple>
</transform>
但没有任何作用。例外是
Failed to invoke method: .replaceAll("<Structure>([^]*)<\/Structure>", "") on null due to: org.apache.camel.language.bean.RuntimeBeanExpressionException: Failed to invoke method: replaceAll("<Structure>([^]*)<\/Structure>", "") on null due to: java.util.regex.PatternSyntaxException: Unclosed character class near index 16
"<Structure>([^]*
^
我认为问题出在开放和密切的括号中。但是像\(
或(
这样的转义并没有帮助