errorString="AxisFault\n
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException\n
faultSubcode: \n
faultString: My Error\n
faultActor: \n
faultNode: \n
faultDetail: \n
{}string: this is the fault detail"
Pattern pattern = Pattern.compile(".*faultString(.*)", Pattern.DOTALL);
Matcher matcher = pattern.matcher(errorString);
if (matcher.matches()) {
String match = matcher.group(1);
return match;
}
I want to get "My Error", but it returns to the end of the whole string instead of matching to the \n at the end of the faultString line. I've tried many techniques to get it to stop at the end of the line, without success.
thanks