code: private static void validateTags(String[] tagList, ArrayList<String> validList, ArrayList<String> invalidList) {
          for (String tag : tagList) {
              tag = tag.trim();
              if (tag.contains("\\") || tag.contains(" ") || tag.contains("\n") || tag.contains("-") || tag.equals("")) {
                  invalidList.add(tag);
              } else {
                  validList.add(tag);
              }
          }
      }
docs: Filter out tags with escaping characters and invalid characters, restrict to only alphabetical and numeric characters
  
  @param tagList
  @return