Expressions/Rules exchange | Page 2

Discussion in 'My TVSeries' started by Inker, April 12, 2007.

  1. djburt

    djburt New Member

    Joined:
    April 10, 2008
    Messages:
    3
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    United States of America United States of America
    Type: Parsing - Simple
    Podcasts
    Description:
    How to parse a podcast with the numbering scheme 0001-9999. Marks all Seasons of the podcast as Season 1.
    Must use String Replacement to insert Season 1 Identifier (Season number identified after -- and before x).
    Code (Text):
    1.  
    2. Example String Replacement
    3.  
    4. Sample Filenames:
    5. diggnation--0142--2008-03-20hamsters--hd.h264.mov
    6. diggnation--0143--2008-03-27foxnews--hd.h264.mov
    7. diggnation--0144--amsterdamnation2--hd.h264.mov
    8.  
    9. Replace This: diggnation--
    10. With This: diggnation--1x
    11.  
    Code (Text):
    1.  
    2. Simple Expression to parse
    3.  
    4. <series>--<season>x<episode>--<title>.<ext>
    5.  



     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. campnic

    campnic Portal Member

    Joined:
    April 3, 2008
    Messages:
    8
    Likes Received:
    0
    Ratings:
    +0 / 0
    Type: Parsing - Regex
    Amazon Unbox Support
    Description:
    I just modified a stock regex to account for Amazon using three digits instead of 2 for the episode number. Bad with regular expressions so I don't know how well it will hold up
    Series - S##E### - Title.Ext

    Code (Text):
    1. ^.*?\\?(?<series>[^\\$]+?)(?:s(?<season>[0-1]?\d)e(?<episode>\d\d\d)|(?<season>(?:[0-1]\d|(?<!\d)\d))x?(?<episode>\d\d))(?!\d)(?:[ .-]?(?:s\k<season>e?(?<episode2>\d{2}(?!\d))|\k<season>x?(?<episode2>\d{2}(?!\d))|(?<episode2>\d\d(?!\d))|E(?<episode2>\d\d))|)[ -.]*(?<title>(?![^\\]*?sample)[^\\]*?(?<HR>HR\.)?[^\\]*?)\.(?<ext>[^.]*)$
     
  4. tzuriel

    tzuriel Portal Member

    Joined:
    March 4, 2008
    Messages:
    8
    Likes Received:
    0
    Ratings:
    +0 / 0
    Type: Parsing - Regex
    Description: This Regex will properly parse shows that have 3 digit episode numbers like Late Show with David Letterman
    so letterman.13104.ep2517.avi will parse out as Season 13 Episode 104


    Expression:

    Code (Text):
    1. ^.*?\\?(?<series>[^\\$]+?)(?:s(?<season>[0-3]?\d)\s?ep?(?<episode>\d\d\d)|(?<season>(?:[0-3]\d|(?<!\d)\d\d))x?(?<episode>\d\d\d))(?!\d)(?:[ .-]?(?:s\k<season>e?(?<episode2>\d{2}(?!\d))|\k<season>x?(?<episode2>\d{2}(?!\d))|(?<episode2>\d\d(?!\d))|E(?<episode2>\d\d))|)[ -.]*(?<title>(?![^\\]*?sample)[^\\]*?[^\\]*?)\.(?<ext>[^.]*)$
     
  5. Erazor2

    Erazor2 Portal Member

    Joined:
    September 6, 2007
    Messages:
    11
    Likes Received:
    0
    Ratings:
    +0 / 0
    Home Country:
    Germany Germany
    Type: Parsing - Regex
    Description: This Regex should match any pathnames like those:
    • The 4400\01\The 4400 - 01x01 02 - Title - eng.avi
    • The 4400\01\The 4400 - 01x03 - Title - eng.avi

    Code (Text):
    1. ^[^\\$]+\\[^\\$]+\\((?<series>[^\\$$]+)( - ))((?<season>[\d]+)x(?<episode>[\d]+)([\s]+(?<episode2>[\d]+))?( - ))((?<title>[^\\$]*)( - ))(?<language>[^\\$]*)\.(?<ext>[^\\$]+)$
     
  6. PUT

    PUT Portal Member

    Joined:
    February 24, 2008
    Messages:
    11
    Likes Received:
    2
    Ratings:
    +2 / 0
    Home Country:
    Sweden Sweden
    Type: Parsing - Regex
    Description: For rar files, excluding part02.rar etc
    My.Show\My.Show.S01E12-NoOne\My.Show.S01E12-NoOne.rar
    My.Show\My.Show.S01E12-NoOne\My.Show.1x13.Foo.Name-NoOne.rar


    Code (Text):
    1. \\(?<series>.+)\.s(?<season>[0-9]+)e(?<episode>[0-9]+).+?\\.+(?:(?<!part\d\d\d|part\d\d)\.rar|\.part0*1\.rar)
    2.  
    3. \\(?<series>.+)\.(?<season>[0-9]+)x(?<episode>[0-9]+).+?\\.+(?:(?<!part\d\d\d|part\d\d)\.rar|\.part0*1\.rar)
     
    • Like Like x 2
  7. UNOPARATOR
    • Premium Supporter

    UNOPARATOR MP Donator

    Joined:
    September 19, 2007
    Messages:
    231
    Likes Received:
    35
    Occupation:
    .NET Developer
    Location:
    Istanbul
    Ratings:
    +37 / 0
    Home Country:
    Turkey Turkey
    Show System Specs
    Type: Parsing RegEx
    Description: This RegEx gets the series name from the first folder (so series like 90210 works),
    handles up to 4 digit season numbers & up to 3 digit episode numbers for S##E## filename formating

    Single episode example:
    Show Name\Show Name - Season #\Show.Name.S##E##.Episode.Name.SOURCE.CODEC-RELEASEGROUP.extension
    Double episode example:
    Show Name\Show Name - Season #\Show.Name.S##E##-##.Episode.Name.SOURCE.CODEC-RELEASEGROUP.extension

    Make this RegEx single line before using:
    Code (Text):
    1. (?:(?<series>^.*?)\\)
    2. (?:\k<series>(?: [\[|\(](?<year>\d{4})[\]|\)]|) - Season \d{1,4}\\)
    3. (?:.*\.S(?<season>\d{1,4})E(?(\d{1,3}\-\d{1,3})(?<episode>\d{1,3})\-(?<episode2>\d{1,3})|(?<episode>\d{1,3})))(?(\.)\.
    4. (?<title>.*)(?:\-(?<releaseGroup>.*)\.|\.)(?:(?<ext>[^.]*)))$
    Note 1: for getting rid of SOURCE & CODEC etc. just add the necessary keywords to String Replacements...
    Note 2: episode2, title, ReleaseGroup fields are optional, if they are not matched they don't break the rest of fields from parsing...

    Updated [2009-11-09]:
    - Added support for "-" character in the title to correctly parse ReleaseGroup when the title includes "-" characters.
    - Also added support for Series Name [####] or Series Name (####) folders under the main series folder...
     
    • Like Like x 1
  8. bjarkimg

    bjarkimg Portal Member

    Joined:
    May 12, 2008
    Messages:
    16
    Likes Received:
    1
    Occupation:
    Developer
    Ratings:
    +1 / 0
    Home Country:
    Iceland Iceland
    Hi just spent few hours parzing this :)

    Type: Parsing - simple/Regex
    yyyy parsing
    Description:
    be able to parse this
    Horizon.s2010e01.titlename....
    Expression:
    Code (Text):
    1. (?<series>[^\\$]*)s(?<season>\d{4})e(?<episode>\d{1,2})
    Keep up the grate work.
     
    • Like Like x 1
  9. Hillbillie

    Hillbillie Portal Member

    Joined:
    June 19, 2009
    Messages:
    30
    Likes Received:
    4
    Occupation:
    I.T. Administrator
    Location:
    Arkansas
    Ratings:
    +4 / 0
    Home Country:
    United States of America United States of America
    Type: Parsing - Regex

    Description:

    Here is the path for my TV Episodes where the '01' is episode #:

    D:\Movies\TV Series\J.A.G\Season 10\01 A New Life.avi
    D:\Movies\TV Series\Man vs. Wild\Season 5\01 Baja Desert.avi
    D:\Movies\TV Series\Sea Patrol\Season 3\01 Catch and Release.avi

    Use the code below to import. Thanks RoChess for the solution.

    Code:
    Code (Text):
    1.  
    2. \\(?<series>[^\\$]+)\\Season\s(?<season>\d+)\\(?<episode>\d+)\s(?<title>.*)\.(?<ext>.*)
    3.  
     
    • Like Like x 1
  10. RoChess
    • Premium Supporter

    RoChess Extension Developer

    Joined:
    March 10, 2006
    Messages:
    4,182
    Likes Received:
    1,304
    Ratings:
    +1,683 / 2
    Your filename has the ' - ' between episode number and title, which throws the expression off, so use:

    Code (Text):
    1.  
    2. \\(?<series>[^\\$]+)\\Season\s(?<season>\d+)\\(?<episode>\d+)\s-\s(?<title>.*)\.(?<ext>.*)
    3.  
    Also be sure to adjust the priority to top position if all your shows are like this, otherwise you might encounter a false positive on the existing expressions.
     
  11. RivaSA

    RivaSA Portal Member

    Joined:
    June 24, 2009
    Messages:
    35
    Likes Received:
    3
    Ratings:
    +3 / 0
    Home Country:
    South Africa South Africa
    :DThanks to everyone that has helped.:D

    These three work like a treat.

    Redexp

    Used For Name\Name s####e## (F1\F1 s2008e01)
    (?<series>[\w]+)\s*(?<season>\d{4})e(?<episode>\d{1,2})

    Used For Name\Name s##e## (v 2009\v 2009 s01e01)
    ^.*?\\?(?<series>[^\\$]+?)(?:s(?<season>[0-3]?\d)\s?ep?(?<episode>\d\d)|(?<season>(?:[0-1]\d|(?<!\d)\d))x?(?<episode>\d\d))(?!\d)(?:[ .-]?(?:s\k<season>e?(?<episode2>\d{2}(?!\d))|\k<season>x?(?<episode2>\d{2}(?!\d))|(?<episode2>\d\d(?!\d))|E(?<episode2>\d\d))|)[ -.]*(?<title>(?![^\\]*?sample)[^\\]*?[^\\]*?)\.(?<ext>[^.]*)$

    Used For Name\Name s##e## (v 2009\v 2009 s01e01)
    ^.*?\\?(?<series>[^\\$]+?)[ .-]+[\#s]?(?<season>\d+)[ .-]?[ex.](?<episode>\d+)[+-]?(?<episode2>\d+)?[ .-]*(?<title>(?![^\\]*?sample)[^$]*?)\.(?<ext>[^.]*)$

    Used For Name\Name s##e#### (Top Gear\Top Gear s00e0222)
    ^.*?\\?(?<series>[^\\$]+?)[ .-]+[\#s]?(?<season>\d+)[ .-]?[ex.](?<episode>\d+)[+-]?(?<episode2>\d+)?[ .-]*(?<title>(?![^\\]*?sample)[^$]*?)\.(?<ext>[^.]*)$

    Hope this helps those who need, they are the only three I use.;)
     
    • Like Like x 1
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!