rpm filename parsing regex help

J

John

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top