以编程方式从文件名确定最高视频质量

So let's say we have the following 3 filenames:

[HorribleSubs] Sora no Method - 12 [480p].mkv.torrent
[HorribleSubs] Sora no Method - 12 [720p].mkv.torrent
[HorribleSubs] Sora no Method - 12 [1080p].mkv.torrent

What would be an efficient way of determining which filename is the highest quality, assuming that 1080p is the highest quality.

So in case 720p is the highest resolution, I want that file to be selected. Or if there is a file with a higher resolution (2.7k), I want that file to be selected.

In other words, I need a way to match the file to any of those 3 resolutions (for now) and determine which filename has the highest resolution