by Luuk » Mon Apr 19, 2021 5:22 pm
Its ok, Im understanding the syntax now! Its was just my poor explanations, but I think of each of the four 'digits' as...
<Digit>: <------------Possibile Strings-----------------> ..... <-------Group Testing------> ...... Simplified Untested
1stDigit: M,MM,MM,nothing.................................. (M{1,3}){0,1} ....................... M{0,3}
2ndDigit: C,CC,CCC,CD,D,DC,DCC,DCCC,CM,nothing .... (C{1,3}|DC{0,3}|C[DM]){0,1} .... (D?C{0,3}|C[DN])?
3rdDigit: X,XX,XXX,XL,L,LX,LXX,LXXX,XC,nothing ......... (X{1,3}|LX{0,3}|X[LC]){0,1} ..... (L?X{0,3}|X[LC])?
4thDigit: I,II,III,IV,V,VI,VII,VIII,IX,nothing .................. (I{1,3}|VI{0,3}|I[VX]){0,1} ....... (V?I{0,3}|I[VX])?
So with Roman-Numeral MIII, its not that I really see 'M00III', but instead 'M,nothing,nothing,III' to describe the missing 'digits'.
The romans were too logical, and did not see a reason to use something for nothing, so never saying zero with Roman-Numerals.
But with regex you must match something, even if its nothing for the missing 'digit', if that makes any sense??
So now its just the regex part giving me troubles, and I do not believe its the above groups to be responsible?
It still conducts a few 'invalids', and sometimes if a filename has many Roman-Numerals, it will not conduct them all.
So first I will get some sleep, then do some testing, and report back when I can get some answers.