Bug Problematic handling of RegEx expression in AdvancedSettings.cpp - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93) +--- Thread: Bug Problematic handling of RegEx expression in AdvancedSettings.cpp (/showthread.php?tid=166730) |
Problematic handling of RegEx expression in AdvancedSettings.cpp - Sesshoumaru - 2013-06-08 Hello I have issues with some regular expressions that are used for recognition of season and episode numbers from TV series. An expression that works fine within a standalone RegEx checker fail in XBMC. I decided to build XBMC to debug the complete handling. Due to the investigation I found the rootcause in the AdvancedSettings.cpp in the code that reads the expression from the XML file. After the expression is read from XML in the method GetCustomTVRegexps [line: 1193] the following code is executed: Code: CStdString regExp = pRegExp->FirstChild()->Value(); This is not very good for regular expression as e.g. (\d+) means something different than (\D+). Some of my expressions fail because of this. I would suggest to remove the MakeLower() call from this method. If nobody objects I would like to create an official bug in TRAC and I would be also willing to fix it. Its a very small fix, so if anybody works on that file it would be nice to just fix it as well Thanks. RE: Problematic handling of RegEx expression in AdvancedSettings.cpp - pieh - 2013-06-08 Hi, I went ahead and created pull request https://github.com/xbmc/xbmc/pull/2851 Nice find! RE: Problematic handling of RegEx expression in AdvancedSettings.cpp - Sesshoumaru - 2013-06-08 No objections from my side I created a regular expression that is able to handle season and episode number extraction in nearly 99% of all anime files nowadays (tested with about 20.000 episodes) and its a pity that it does not work correctly because of this issue. RE: Problematic handling of RegEx expression in AdvancedSettings.cpp - pieh - 2013-06-08 Aaaaaaand merged. Thanks for this very detailed bug report! |