code: func (pe *PathExp) CompareSpecificity(other *PathExp) int {
  	if cmp := compareSegmentType(pe.Envs, other.Envs); cmp != 0 {
  		return cmp
  	}
  
  	if cmp := compareSegmentType(pe.Services, other.Services); cmp != 0 {
  		return cmp
  	}
  
  	if cmp := compareSegmentType(pe.Identities, other.Identities); cmp != 0 {
  		return cmp
  	}
  
  	return compareSegmentType(pe.Instances, other.Instances)
  }
docs: // CompareSpecificity returns an int indicating if this PathExp is more
  // specific than PathExp b.
  //
  // PathExp A is more specific then PathExp B if, for each segment in the
  // PathExp, A's segment is as specific or more specific than B's segment.
  //
  // Segment specificity is, from most to least specific:
  //	- <literal>
  //  - <glob>
  //  - <alternation>
  //  - <fullglob>
  //
  // It is assumed that the provided PathExps are not disjoint.