rpm filename parsing regex help

Discussion in 'Perl Misc' started by John, Aug 8, 2003.

  1. John

    John Guest

    I am trying to write a tool to help me synchronize newer redhat rpms
    so i can burn updated cds instead of doing it manually.

    The current pattern I use matches the majority from which i dump it
    into a hashtable. The lhs would be the filename and the rhs would be
    the version number.

    /^([a-zA-Z\-\_]+)([0-9a-zA-Z\.\-]+)\.[a-z0-9|a-z]+\.rpm/ )

    Although this matches the filename patterns for the rpms, there is one
    case I have not been able to figure out

    ko2-fonts-0.3.9b-16.9 for example.

    The issue is that the pattern splits up ko2-fonts to ko
    2-fonts-0.3.9b-16.9

    Is there a solution for parsing rpm filenames somewhere or would
    someone better at regexs help me with this?

    thanks

    Greg
    John, Aug 8, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Sm9l?=

    Extract filename from a filename typed by user

    =?Utf-8?B?Sm9l?=, Aug 23, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,019
    Travis Murray
    Aug 24, 2004
  2. Scott Chapman
    Replies:
    0
    Views:
    353
    Scott Chapman
    Oct 3, 2003
  3. Cliff Wells
    Replies:
    1
    Views:
    342
    Paul Boddie
    Oct 13, 2003
  4. Zhi Min
    Replies:
    0
    Views:
    402
    Zhi Min
    Jun 11, 2004
  5. Steven W. Orr
    Replies:
    1
    Views:
    275
    Steven W. Orr
    Mar 4, 2011
Loading...

Share This Page