code: public static void validateAttachmentLabel(String label)
        throws MonomerException {
  
      if (label.equalsIgnoreCase(Attachment.PAIR_ATTACHMENT)) {
        return;
      }
      char[] chars = label.toCharArray();
  
      if (!(String.valueOf(chars[0])).equals("R")) {
        throw new MonomerException("Invalid Attachment Label format");
      }
      for (int i = 1; i < chars.length; i++) {
        char c = chars[i];
        if (!(String.valueOf(c)).matches("[0-9]")) {
          throw new MonomerException("Invalid Attachment Label format");
        }
      }
    }
docs: This method checks if attachment label is in the format of R#, where # is a
  number
  
  @param label attachment label
  @throws org.helm.notation2.exception.MonomerException if label is not valid