我需要使用java在2个特定单词之间用正斜杠/匹配和替换反斜杠\。我试过这个,它在正则表达式测试器https://regexr.com/474s0中运行良好,但当我从基于 java 的应用程序测试时无法运行;收到此错误。
org.apache.oro.text.regex.MalformedPatternException:序列 (?<...) 无法识别
正则表达式尝试: (?<=<(DocumentImagePath)>.*?)(\\)(?=.*<\/(DocumentImagePath)>)
样本 :
<DocumentImagePath>95230-88\M0010002F.tif\test</DocumentImagePath>
<DocumentImagePath>123-88\M0010002F.tif\test</DocumentImagePath>
<DocumentImagePath>abc-88\M0010002F.tif\test</DocumentImagePath>
任何帮助表示赞赏。
注意:我了解并非所有编译器都支持正面外观,但正在寻找适用于 Java 的合适替代正则表达式。
慕妹3242003
相关分类