public static String @NotNull [] getParts(@Nullable Pattern pattern) {
    if (pattern == null) {
      return ArrayUtilRt.EMPTY_STRING_ARRAY;
    }

    List<String> parts = new ArrayList<>();
    String sPattern = pattern.toString();

    StringBuilder part = new StringBuilder();
    boolean inSquare = false;
    for (int i = 0; i < sPattern.length(); i++) {
      char ch = sPattern.charAt(i);
      if (!inSquare && Character.isLetterOrDigit(ch)) {
        part.append(sPattern.charAt(i));
      }
      else if (part.length() > 0) {
        parts.add(part.toString());
        part = new StringBuilder();
      }

      inSquare = ch != ']' && ((ch == '[') || inSquare);
    }

    return ArrayUtilRt.toStringArray(parts);
  }
public static String @NotNull [] getParts(@Nullable Pattern pattern)