Let's say I have code below:
Pattern pt = Pattern.compile("(?:h)?o");
Matcher m = pt.matcher("hours 123");
m.find();
System.out.println(m.group(0));
And the result is
ho
Here in regex I have a non-capturing group (?:h). Why is this group included in the final results? I just want to get "o" instead.