xbmc/xbmc — pull request #5499 by clashlab (2014-10-13 15:23:15+00:00)
Title: Allow named groups on m_videoCleanDateTimeRegExp

Some of my video files are name with the year before the movie title (ie: "1999 - Matrix"). I didn't find a way to only change cleandatetime in advancedsettings.xml to allow this naming (the first group is hardcoded to be the title, the second the year). So here's a patch to use named groups allowing to place year and title in any order.

I defined 2 groups: "year" and "title". To name a group, simply put "?P<group_name>" juste after the opening parenthesis.
As advancedsettings.xml is an XML file, the '<' and '>' characters will have to be escaped "&lt;" and "&gt;" respectively, so a named group will start with "?P&lt;group_name&gt;"

I also change the default value for m_videoCleanDateTimeRegExp to support the actual naming and the one I introduced.

Also, using the named groups "title" and "year" isn't mandatory, the actual regex will still work as expected.