code: protected static boolean compareAttributes(String left, String right) {
          //the numbers below come from the CPE Matching standard
          //Table 6-2: Enumeration of Attribute Comparison Set Relations
          //https://nvlpubs.nist.gov/nistpubs/Legacy/IR/nistir7696.pdf
  
          if (left.equalsIgnoreCase(right)) {
              //1 6 9
              return true;
          } else if (LogicalValue.ANY.getAbbreviation().equals(left)) {
              //2 3 4
              return true;
          } else if (LogicalValue.NA.getAbbreviation().equals(left)) {
              //5 7 8
              return false;
          } else if (LogicalValue.NA.getAbbreviation().equals(right)) {
              //12 16
              return false;
          } else if (LogicalValue.ANY.getAbbreviation().equals(right)) {
              //13 15
              return false;
          }
          //10 11 14 17
          if (containsSpecialCharacter(left)) {
              Pattern p = Convert.wellFormedToPattern(left.toLowerCase());
              Matcher m = p.matcher(right.toLowerCase());
              return m.matches();
          }
          return false;
      }
docs: This does not follow the spec precisely because ANY compared to NA is
  classified as undefined by the spec; however, in this implementation ANY
  will match NA and return true.
  
  This will compare the left value to the right value and return true if
  the left matches the right. Note that it is possible that the right would
  not match the left value.
  
  @param left the left value to compare
  @param right the right value to compare
  @return <code>true</code> if the left value matches the right value;
  otherwise <code>false</code>