如何将“Because it already exists
”与下面字符串中的正则表达式匹配:
<faultstring>Error has occured! Reason why: Because it already exists. request id: 443p3-34356a</faultstring>
此表达失败:
(.+)+Because it already exists(.+)+
我需要匹配<faultstring></faultstring>
同样,所以我需要匹配 Because it already exists
内部错误字符串开始和结束标签
注意:
这是一个多行字符串,我刚刚打印了这个,它很重要。
最佳答案
我认为你不想要那些外在的优点。
(.+)Because it already exists(.+)
关于java - 如何匹配前面有任何其他文本的某些文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3254367/