SI-6888 Loosen criteria for $outer search

In order to cater for nested classes with names that end
with '$', which lead to ambiguity when unmangling expanded
names.