In rubular iam using regex 'docsBpi2CmDeviceManufCert.2 = Hex-STRING:(\s\w.*$\s\w.*)+
' to find hex values from below string and getting the expected value
String
docsBpi2CmDeviceManufCert.2 = Hex-STRING: 30 82 03 D1 30 82 02 B9 A0 03 02 01 02 02 10 60
F5 8D 9C E7 FF BC D8 79 AF 4E D7 B3 76 1E 7F 30
0D 06 09 2A 86 48 86 F7 0D 01 01 05 05 00 30 81
EC DC 34 84 EE
But following sample java code not returns the pattern
Pattern patternToMatch = Pattern.compile("docsBpi2CmDeviceManufCert.2 = Hex-STRING:(\\s\\w.*$\\s\\w.*)+");
String response11 = "docsBpi2CmDeviceManufCert.2 = Hex-STRING: 30 82 03 D1 30 82 02 B9 A0 03 02 01 02 02 10 EC DC 34 84 EE";
String matchedString = "";
// instance of pattern for match
Pattern pattern = null;
// Instance of matcher
Matcher matcher = null;
if (null != response11) {
matcher = patternToMatch.matcher(response11.trim());
if (matcher.find()) {
matchedString = matcher.group(1);
}
}
Whats wrong with my code