Updated REGEX Noise Filter (1 Viewer)

jacc1234

Portal Pro
April 11, 2008
167
7
I have modified the regex filter used to remove various phrases found in file names. Here is what I have:
((720p|1080p|1080i|576p|Limited|Extended|DirCut|DVDRip|DVDScreener|DVDScr|AVCHD|WMV|NTSC|MPEG|DSR|R5|DVDR|DTS|AC3|Bluray|Blu-ray|HDTV|PDTV|HDDVD|XviD|DiVX|x264|dxva)[-]?.*?$)

All I added was 576p, Limited and Extended. I have found those keywords tend to show up and confuse the plugin. I hope this helps out and please let me know if there are any issues with my logic. I understand that its possible that there are movie titles with limited or extended but so far I have not run into any.
 

armandp

Retired Team Member
  • Premium Supporter
  • April 6, 2008
    990
    620
    Zoetermeer
    Home Country
    Netherlands Netherlands
    The updated filter in the current SVN version is:

    Code:
    ((720p|1080p|1080i|dircut|directors cut|dvdrip|dvdscreener|dvdscr|avchd|wmv|ntsc|mpeg|dsr|r5|dvdr|dvd5|dvd9|bd5|bd9|dts|ac3|bluray
    |blu-ray|hdtv|pdtv|hddvd|xvid|divx|x264|dxva|(?-i)LIMITED|DC|UNRATED)([-].+?$)?)

    note that the last 3 words are case sensitive matches. There's another flaw in the expression btw and that is that it matches within strings also.. i will try and update this to only match complete words. This will be a problem if you add a keyword like PAL ;)
     

    jacc1234

    Portal Pro
    April 11, 2008
    167
    7
    To prevent it from having partial matches you will need to use the \b metacharacter. It specifies word boundaries so if we did \bPAL\b it would match movie.pal.xvid but would not match opal or pals or any other partial match. Is this what you are looking for?

    Here is a link with more info: Regex Tutorial - \b Word Boundaries
     

    armandp

    Retired Team Member
  • Premium Supporter
  • April 6, 2008
    990
    620
    Zoetermeer
    Home Country
    Netherlands Netherlands
    Yeah i know about the word boundaries i'm currently testing some new expressions so it won't be long.
    Also a setting with just the keywords is probably the best thing to do for users unfamiliar with regular expressions. This filter can seriously mess-up the whole import process :) If we limit users to just enter keywords they want filtered it would be much safer :p
     

    armandp

    Retired Team Member
  • Premium Supporter
  • April 6, 2008
    990
    620
    Zoetermeer
    Home Country
    Netherlands Netherlands
    oke this should work:

    Code:
    (\b(720p|1080p|1080i|dircut|directors cut|dvdrip|dvdscreener|dvdscr|avchd|wmv|ntsc|pal|mpeg|dsr|r5|dvdr|dvd5|dvd9|bd5|bd9|dts|ac3|bluray
    |blu-ray|hdtv|pdtv|hddvd|xvid|divx|x264|dxva|(?-i)LIMITED|DC|UNRATED)\b([-].+?$)?)
     

    jacc1234

    Portal Pro
    April 11, 2008
    167
    7
    Cool, ill test it out and let you know if I run into any issues. It looks good from here though. Thanks for all the work all of you guys are putting into this plugin.
     

    Users who are viewing this thread

    Top Bottom