I am trying to match the following pattern in a string and extract it as a substring.
The pattern always follows
<D-10-helloworld-84>
The 'D' can either be 'D' or 'E' but nothing else. the message in the middle can have any character and each number is always a digit decimal (5 would 05 for example).
I have tried the following:
String text = "sdsas<D-10-helloworld-84>kjvkjv";
Pattern pattern = Pattern.compile("^<[ED]-[0-9]{2}-(.?)-[0-9]{2}>$");
Matcher matcher = pattern.matcher(noiseFrame);
String newText = matcher.group(1);
But not match is being found. What's happening here? Thanks