code: public static List<Variable> getVariablesByRegex(
        final Collection<Variable> variables, final String regex) {
      final List<Variable> shortlistedVariables = new ArrayList<>();
      if (variables != null && regex != null) {
        for (final Variable var : variables) {
          if (var.getTitle().matches(regex)) {
            shortlistedVariables.add(var);
          }
        }
      }
      return shortlistedVariables;
    }
docs: Shortlist variables which match a given regex. Returns empty empty list, if no
  eligible variable is found