ByteList value = str.getByteList();
Matcher matcher = pattern.matcher(value.getUnsafeBytes(), value.getBegin() + pos, value.getBegin() + value.getRealSize());
final int ret;
if (headonly) {
ret = matcher.match(value.getBegin() + pos, value.getBegin() + value.getRealSize(), Option.NONE);
} else {
ret = matcher.search(value.getBegin() + pos, value.getBegin() + value.getRealSize(), Option.NONE);
}
regs = matcher.getRegion();