Definitely less errors now and matching up more than before ;)
There are still 4 errors left but I have been testing with different regex
I took the remaining files names from the error list and added it into an online regex editor as values to search against +(I also added 1 filename where the sequential number has a v2 added to it as it didn't process that one either)
I then looked in the regex you are using to compare
sequence number
with and checked the results from it.
First one is:
"(E|e|Ep|ep|episode|Episode) ?0*(?<sequencenumber>\d+)\D"
Now for me personally, I have never seen any files with those tags right in front of a sequence number,
but with your years of experience in developing TVR I'm sure you have seen it some times so let's check it in the
online regex editor.
In my case it should not match any of those files as they don't use any of the tags in the sequence number,
and that part it does correctly... well at least for the first 5 filenames.
The problem comes when filenames has a hash number in them like this: [1E6E13DB]
The quick and easy fix I saw at first was just to make sure it checked if there were a space before the episode tags like this:
That fixed my problem... But Wait!!! then I thought what about filenames that started with one of the episode tags as they would then not be recognized anymore.
We would have to add another check if the episode tags are searched in the start of a filename as well.
So I cooked up this one instead: "(^(E|e|Ep|ep|episode|Episode)| (E|e|Ep|ep|episode|Episode)) ?0*(?<sequencenumber>\d+)\D"
Changed the "\s" to an space character as well as it was checking new lines as well, though it would not matter as in your case, you are checking a 1 line string without newline character in it ;)
But as you can see, that should work nicely :)
Next is
regex: "\D 0*(?<sequencenumber>\d+) \D"
This one is the one that should match all the correct episode numbers for me so let's take a look at it:
It Matches all the filenames with the correct number except the 082v2 as it got the v2 in it
Now the easiest way to fix this in my case would be to remove the space right before the last "\D" but there is probably a reason you had it there so I didn't want to compromise that solution as it could break something else.
So instead I adding this "(?:v[0-9]+)?" right after the"
(?<sequencenumber>\d+)"
It checks if there is a v followed by at least 1 number in a non-capturing group (Just so it doesn't return a unusable value) and make sure there is only one or none attached to the
sequence
number.
The full regex is like this then: "\D 0*(?<sequencenumber>\d+)(?:v[0-9]+)? \D"
With the changes I have mentioned, it should in theory fix all my problems without changing the way they are already working and not break it for others.
Hope you would consider these changes :)