/**
   * 使用scan正则表达式检索
   *
   * @param regex 正则表达式
   * @param count 增量迭代
   */
  public Set<String> scan(String regex, long count) {
    ScanOptions options = ScanOptions.scanOptions()
        .match(regex)
        .count(count)
        .build();
    return redisTemplate.execute((RedisCallback<Set<String>>) connection -> {
      Set<String> keys = new HashSet<>();
      Cursor<byte[]> cursor = connection.scan(options);
      while (cursor.hasNext()) {
        keys.add(new String(cursor.next()));
      }
      return keys;
    });
  }