Custom regular expression request (1 Viewer)

mfsav2

Portal Member
March 11, 2008
22
0
Re: Expressions/Rules exchange

Expresso still gives me the error: Nested quantifier *

I just copied and pasted his expression in Expresso and it works fine for me. So you might want to look at your method of copy-n-pasting.

On the other hand his expression is still wrong, but I'm sure he can fix that part for ya.

Now I feel very stupid... are there multple way to copy paste ?
I was just selecting the text from the forum and pasting it in the Express app.

:(

do you have another expression that works? :):D
 

Chubler

Portal Member
July 14, 2009
46
25
Home Country
Australia Australia
Re: Expressions/Rules exchange

Expresso still gives me the error:
Nested quantifier *
It's the ignore WS option - expression needs to match white space to work, turn this option off.

RegexBuddy does compile it but it does not match several strings:
movie 2 - 3.mkv
...
Fixed with below, but damn I had a lot of complexity stopping part 3 on it's own as (I was sure you didn't want something like "foo - 3.iso") still smaller solution now:
[noparse]^(?<movie>[^-]*?)(?:[- [])+(?:(?:CD|part|DVD)?(?<part1>0*1)]?)?(?: *(?:CD|part|DVD)?(?<part2>0*2)]?)?(?: * (?:CD|part|DVD)?(?:0*3)]?)?\.(?<ext>[^.]*)$[/noparse]
 

Inker

Retired Team Member
  • Premium Supporter
  • December 6, 2004
    2,055
    318
    Re: Expressions/Rules exchange

    Guys, don't get me wrong, I'm glad your helping each other with the regex and all, but movies regex stuff doesnt really belong here. Its fine when its just a few posts, but its been going back and forth for a while now. It's not like theres much else going on in here, so no big deal, but I'd still like to split this off somewhere else.

    mfsav2, what are you needing this expression for? I'll move the discussion to an appropriate subforum.
     

    Chubler

    Portal Member
    July 14, 2009
    46
    25
    Home Country
    Australia Australia
    Re: Expressions/Rules exchange

    Inker,

    Yes please do move this somewhere else, as I stated earlier this should have been in it's own thread.
     

    mfsav2

    Portal Member
    March 11, 2008
    22
    0
    Re: Expressions/Rules exchange

    Inker,
    I need this for an NFO parsing application developed in VB.NET mainly focused on Network Media Tanks.

    Thank you for your kindness and help, sorry for messing up this tread :( let me know where is appropriate to start the new one and I will move there.

    Mf
     

    Inker

    Retired Team Member
  • Premium Supporter
  • December 6, 2004
    2,055
    318
    So we split it off for now. I don't really know what subforum this should go to. If you know let me know. Otherwise we can just leave it here I guess.
     

    Chubler

    Portal Member
    July 14, 2009
    46
    25
    Home Country
    Australia Australia
    Great, thanks Inker.

    mfsav2,

    I've been testing my expression in post 12 with Expresso, and although it works against all the examples you supplied with a 100% hit-rate. The [ and ] matching is not working properly for CD2 and CD3. The following fixes this but still allow some false positives, this can be corrected but would end up more than doubling the expression size:

    [noparse]^(?<movie>[^-]*?)(?:[- [])+(?:(?:CD|part|DVD)?(?<part1>0*1)]?)?(?: *\[?(?:CD|part|DVD)?(?<part2>0*2)]?)?(?: * \[?(?:CD|part|DVD)?(?:0*3)]?)?\.(?<ext>[^.]*)$[/noparse]


    Some positives you might not like:

    foo [[[1]2.iso
    foo - 1][2 3.iso
    foo ]]][[[1 2.iso
     

    mfsav2

    Portal Member
    March 11, 2008
    22
    0
    Great, thanks Inker.

    mfsav2,

    I've been testing my expression in post 12 with Expresso, and although it works against all the examples you supplied with a 100% hit-rate. The [ and ] matching is not working properly for CD2 and CD3. The following fixes this but still allow some false positives, this can be corrected but would end up more than doubling the expression size:

    [noparse]^(?<movie>[^-]*?)(?:[- [])+(?:(?:CD|part|DVD)?(?<part1>0*1)]?)?(?: *\[?(?:CD|part|DVD)?(?<part2>0*2)]?)?(?: * \[?(?:CD|part|DVD)?(?:0*3)]?)?\.(?<ext>[^.]*)$[/noparse]


    Some positives you might not like:

    foo [[[1]2.iso
    foo - 1][2 3.iso
    foo ]]][[[1 2.iso

    Chubler
    you have been very kind but I'm still not able to use your expression.

    I tried everthing, copy paste from the message, from the reply text, typed it in.

    I really feel dumb!

    (Attached you have the error image and my XSO file.)

    Can you be so kind to send me your XSO? (From expresso save the project and zip it)


    Thanks,
    Mf
     

    Attachments

    • Expresso error 1.jpg
      Expresso error 1.jpg
      26.1 KB
    • Expresso 1.zip
      725 bytes

    Chubler

    Portal Member
    July 14, 2009
    46
    25
    Home Country
    Australia Australia
    OK I looked at your project - Firstly it was an expresso version 1.0 project (I'm currently using 3.0). Secondly you still had the Ignore white option turned on.

    Loaded your project with expresso 3.0.3634.15621 (Performing upgrade on import) and turned off "Ignore white" it works fine. I've also attached my project for for you to try out.
     

    Attachments

    • mfsav2_expresso.zip
      840 bytes

    mfsav2

    Portal Member
    March 11, 2008
    22
    0
    GREAT!
    thank you! I started from the source code of Expresso and do not know why I got only 1.0 :(

    In any case it works great, I've changed in:
    [noparse]^(?<movie>[^-]*?)(?:[- [])+(?:(?:CD|part|DVD)?(?<part1>0*1)]?)?(?: *\[?(?:CD|part|DVD)?(?<part2>0*2)]?)?(?: * \[?(?:CD|part|DVD)?(?<part2>0*3)]?)?\.(?<ext>[^.]*)$[/noparse]

    so that part 3 and 2 go under the same are like for the other RegEx.

    I have still one think I do not understand:
    if you try those two:
    movie 2 - 3.mkv
    foo - 01.iso
    foo - 02.iso

    It is funny as the 3 (for the first one) appears to be Part 2 not Part 1. Is great that the name is detected correctly

    foo - 01.iso -> 01 is detected in Part 1
    foo - 02.iso -> 02 is detected in Part 2


    Is not a major problem but I do not understand why...

    Mf
     

    Users who are viewing this thread

    Top Bottom