The solution below works for all test cases that you have provided (and some additional ones as titlelize, see the code below) and are intended for customization.
In short, try the screenshot below :
<mark><b>Paste and Try!</b></mark> ⇒ <input id="input" type="text" size="70" /> <br>↳ <span id="output" style="line-height:40px;">No Match</span> <hr> <div id="list"></div>
Description
Assuming the header is structured something like this:
Name * || [ Year * ] || [ Codec ] Extension
Fields enclosed in square brackets are optional (for example, [ field1 ])
*: saved field
The key must match everything as title until the last valid year (valid years: 1900-2016) or to the extension file> (structured as a dot plus 3 letters, a simple change if necessary).
Exceptions: in the case when the film does not contain a valid year in all sections, starting with (case insensitive) bluray or [0-9]+p (for example, 720p , 1080p ) or brrip is lost from the title section.
Regular Expression Break and emsp; Regex101 demo
/^ (.+?) # Save title into group $1 [.( \t]* # Remove some separators (?: # Non capturing group (19\d{2}|20(?:0\d|1[0-6])).* # Save years (1900-2016) in $2 | # OR (?:(?=bluray|\d+p|brrip)..*)? # Match string starting with bluray,brrip,720p... [.](mkv|avi|mpe?g)$) # Match extension (.mkv,.avi.,mpeg) add your own /i # make the regex case insensitive

Regular expression customization
The list of exceptions and extensions can be easily filled with new values ββduring tests if necessary / if necessary (as a file extension, for example, to add .wmv and .flv add them to the section (mkv|avi|mpe?g|wmv|flv) regex) or in order to make a general section, replace it with [.]\w{3,4}$ .