The OrderBy method can potentially take an IComparer<T> argument. (I'm not sure if that overload can be used with query comprehension syntax, or if it's only available when using the fluent extension method syntax.)

Since it's not clear exactly what your sort algorithm should involve, I'll leave implementing the required IComparer<T> as an exercise for the reader.

I'm still unsure of the actual pattern we are trying to sort on but I wrote what I thought would be a solution. I saw "_" as a kind of wildcard where "abc2_" would be a subset of "abc_". But from the OPs comments "bar_" < "barxyz" breaks my understanding. Here's my code and I can modify when I gain more clarity.