cgeo/c-geo-opensource — comment on commit afaff63b3bd2881b5e4d7dbb84380c3fade544cd
File:  line 0
By samueltardieu:

Won't "abc123def" compare equal to "abc123xyz"? There may be a suffix after the number, or if you don't want one, the pattern should contain an extra '$' to force it to go to the end (and have a fallback to lexicographic order otherwise).

I would suggest that you define a "comparingName" for a cache, that gets initialized when it is first requested with the value of the cache name with the first number changed to normalize it on 6 digits. If you don't cache it, it can be very costly when sorting a list, as this will be evaluated over and over.

For example, "abc123def456" would resolve to "abc000123def456" and be computed only once.