There are two ways for the grouping sort to work. With strict matching, the comparison string must match exactly for the sort to apply. So for example if you specifically want a location, say 'ER1', to be sorted to the top you would use strict matching. 'ER1' location will sort to the top, while any other locations such as 'ER11' would not.
Strict matching can be useful if your sort is putting stuff you don't want at the top. So if you have a priority sort 'S' but one of your low priority codes was 'SD', strict would keep those 'SD's from sorting to top along with the 'S' stats.
With loose matching a single sort can match on a portion of the string. So for example if you have multiple ER locations but do not want to define multiple sorts, you could use loose matching. If your ER locations are 'ER1, ER2, ERS, ERM...' you could simply put 'ER' as the comparison string, and all those locations will be pulled to the top since they match on the first two letters.
The Matching Mode option is available in versions 1.78 and above.