I am a complete Regex Noob and have spent hours trying to solve this riddle. I think I need to use some kind of optional non-exciting groups or striping.
I want to match the following lines:
Neuer Film a von 1000
Neuer Film a von 1000 mit b
Neuer Film a von 1000 mit b und c
Neuer Film a von 1000 mit b und c und d
Neuer Film a mit b
Neuer Film a mit b und c
Neuer Film a mit b und c und d
My regex looks like this:
var regex = /(?:[nN]euer [Ff]ilm\s?)(.*)(?:[vV]on).(\d{4}).(?:[Mm]it)(.*)(?:[uU]nd)(.*)/g;
The problem is that it only matches lines 3 and 4. And it does not match the last two "und", but it packs it into group No.3, and not into group No.4.
Can anyone help with my Regex (which is not very user friendly at all)
source share