Comment: if this is an episode, lets match the season
Comment: number one way or another. if not, the year of the movie
Comment: make sure this is not just a number in the title followed by our separator.
Comment: like, iron man 3 2013 or my.fictional.24.series
Negative Lookahead(?! \d+ \2 ) \d+a digit, repeated at least once
\2the text saved by group 2
Comment: now try to match the season number
Non-Capturing Group(?: s (?: \2? )? )? ?repeats the group contents below at most once:
s the literal text s (case insensitive) Non-Capturing Group(?: \2? )? ?repeats the group contents below at most once:
\2?optionally matches the text saved by group 2
Group season(?<season> \d\d? ) \da digit
\d?optionally matches a digit
Non-Capturing Group(?: e|x (?:\2? )? ) ethe literal text e (case insensitive) 2nd Alternativex (?:\2? )? x the literal text x (case insensitive) Non-Capturing Group(?:\2? )? ?repeats the group contents below at most once:
\2?optionally matches the text saved by group 2
Group episode(?<episode> \d\d? ) \da digit
\d?optionally matches a digit
Comment: needed to validate the last token is a dot, or whatever.
Non-Capturing Group(?: e\d\d? (?:-e?\d\d?)? | x\d\d? )? ?repeats the group contents below at most once:
1st Alternative e\d\d? (?:-e?\d\d?)? ethe literal text e (case insensitive) \da digit
\d?optionally matches a digit
Non-Capturing Group(?:-e?\d\d?)? ?repeats the group contents below at most once:
-the literal - (4510 / 558 / 2D16)
e?optionally matches the literal e (10110 / 1458 / 6516) (case insensitive)
\da digit
\d?optionally matches a digit
xthe literal text x (case insensitive) \da digit
\d?optionally matches a digit