if(offset <= strInput.length() && matcher.contains(input, pattern)) {
MatchResult result = matcher.getMatch();
int groupCount = result.groups();
Array posArray = new ArrayImpl();
Array lenArray = new ArrayImpl();
for(int i = 0; i < groupCount; i++) {
int off = result.beginOffset(i);
posArray.appendEL(Integer.valueOf(off + 1));
lenArray.appendEL(Integer.valueOf(result.endOffset(i) - off));
}
Struct struct = new StructImpl();
struct.setEL("pos", posArray);
struct.setEL("len", lenArray);
return struct;
}
Array posArray = new ArrayImpl();
Array lenArray = new ArrayImpl();
posArray.appendEL(Constants.INTEGER_0);
lenArray.appendEL(Constants.INTEGER_0);
Struct struct = new StructImpl();
struct.setEL("pos", posArray);
struct.setEL("len", lenArray);
return struct;