In Java 6, you can't have named groups, so you need to reference the groups by index.
Given this pattern:
Pattern pattern = Pattern.compile("(foo).*(bar)")
and this code:
Matcher matcher = pattern.matcher("foo....something...else...bar");
matcher.find();
matcher.group(0)
matches the entire String, matcher.group(1)
returns "foo" and matcher.group(2)
returns "bar"