Results 1 to 6 of 6

Thread: reg expressions

  1. #1

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729

    reg expressions

    I have to find folders that have the following sintax:
    [100% Complete]-[100% Damaged]-[7 Tracks@38MB]-[LastCheck 31-01-2004]
    so..
    [xxx Complete]-[xxx Damaged]-[xxx Tracks@xxMB]-[LastCheck xxx]
    I dont know anything about reg expressions, could anyone help me out?
    \m/\m/

  2. #2
    Fanatic Member pax's Avatar
    Join Date
    Mar 2001
    Location
    Denmark
    Posts
    840
    Hi.

    Try something like this:
    [[][0-9].*?% Complete[]]-[[][0-9].*?% Damaged[]]-[[][0-9].*? Tracks@[0-9].*?MB[]]-[[]LastCheck [0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9][]]

    This might need some tweaking, because "100%" and "1 0 0 %" will both succed, so it's not foolproof, but it will match the string in your post.

    BTW: you might wan't to look at www.regular-expressions.com.
    They have a very good tutorial on RegEx.

    Hope it helps.
    I wish I could think of something witty to put in my sig...

    ...Currently using VS2013...

  3. #3

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    Well much tks, ill try it and will read the tuturial too as i want to be able to do it next time for myself
    \m/\m/

  4. #4

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    could you change it for

    [86,3% Complete]-[0 Damaged]-[7 Tracks@33MB]-[LastCheck 01-02-2004]
    please? I'm reading the tuturial in the meantime..

    thanks!
    \m/\m/

  5. #5

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    bump gump dump
    \m/\m/

  6. #6
    Fanatic Member pax's Avatar
    Join Date
    Mar 2001
    Location
    Denmark
    Posts
    840
    Hi.

    I believe this ought to do it.

    [[][0-9].*?% Complete[]]-[[][0-9].*? Damaged[]]-[[][0-9].*? Tracks@[0-9].*?MB[]]-[[]LastCheck [0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9][]]

    The only change is actually to % before the "Damaged" part.
    Now it just checks that after the complete part, there should be a number. After that it accepts everything repeatedly until it see a space.

    the ".*?" means that all characters are accepted and repeated until the it meets the character after the ?-mark.

    Hope you can use it.
    I wish I could think of something witty to put in my sig...

    ...Currently using VS2013...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width