I have two test strings
mp4/dach/zdf/22/07/220724_traumorte_italiens_romantische_inseln_inf/1/220724_traumorte_italiens_romantische_inseln_inf_508k_p9v15.mp4
and
/mp4/none/zdf/21/11/211124_1925_sendung_ban/1/211124_1925_sendung_ban_a3a4_508k_p9v15.mp4
I want a single RegEx to match the first string to get an output
/dach/zdf/22/07/220724_traumorte_italiens_romantische_inseln_inf/1/220724_traumorte_italiens_romantische_inseln_inf
which I get with the RegEx ^.*[mp][4](.+)(?:a[0-9]a[0-9])?(?:.+_.+_.+_|_.+_).*$
or
^.*[mp][4](.+)(a[0-9]a[0-9]?(.+_.+_.+_)|(_.+_)).*$
but this matches the second string as /none/zdf/21/11/211124_1925_sendung_ban/1/211124_1925_sendung_ban_a3a4
but my expectation is to match 3 times _ if a3a4 is present; otherwise 2 times _
which should get the match /none/zdf/21/11/211124_1925_sendung_ban/1/211124_1925_sendung_ban for the second string.
But, somehow this is not grouping (Group -1) as intended.
Any pointers on this is appreciated.
Thanks!