The primary key of the sort is the number of literal characters in the full URI matching pattern. ... The secondary key of the sort is the number of template expressions embedded within the pattern—that is, {id} or {id : .+}. This sort is in descending order. ... The tertiary key of the sort is the number of nondefault template expressions. A default template expression is one that does not define a regular expression—that is, {id}.