I have the below java string in the below format.
externalCustomerID: { \"custToken\": \"xyz\" }
I want to extract xyz value from above string. can anyone suggest me any regex expression for that in java?
I have the below java string in the below format.
externalCustomerID: { \"custToken\": \"xyz\" }
I want to extract xyz value from above string. can anyone suggest me any regex expression for that in java?
check this one
Pattern pattern = Pattern.compile("(\\w+: \\{ \"\\w+\": \")(\\w+)");
Matcher matcher = pattern.matcher("externalCustomerID: { \"custToken\": \"xyz\" }");
if (matcher.find()) {
System.out.println(matcher.group(2));
}