Pattern.offset(): change the logic for determining address or string