Nice! Ok, that regex is truly horrifying, but if it works ¯\(ツ)/¯
I’ve not read the code in detail, but I wonder if the regex could be built dynamically from the set of available PNGs. Basically something like string.Join('|', imageNames.OrderByDescending(n => n.Length).Select(HexToRegex).ToArray())