String exceptionMessage = "These policy alternatives can not be satisfied: \n"
+ "{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}SupportingTokens\n"
+ "{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}UsernameToken";
String exceptionMessagePattern = "[color=red](?s)[/color].*These policy alternatives can not be satisfied:.*";
boolean isExceptonMessage = Pattern.matches(exceptionMessagePattern, exceptionMessage);
System.out.println("--" + isExceptonMessage);
结果是true
+ "{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}SupportingTokens\n"
+ "{http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702}UsernameToken";
String exceptionMessagePattern = "[color=red](?s)[/color].*These policy alternatives can not be satisfied:.*";
boolean isExceptonMessage = Pattern.matches(exceptionMessagePattern, exceptionMessage);
System.out.println("--" + isExceptonMessage);
结果是true