Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Regex to break up rpm filenames

by xmath (Hermit)
on Feb 22, 2003 at 13:45 UTC ( [id://237727]=note: print w/replies, xml ) Need Help??


in reply to Regex to break up rpm filenames

$filename = "urpmi-parallel-ssh-4.0-20.1mdk.noarch.rpm"; print "$filename\n"; if ($filename =~ /^(.+)-([^-]+)-([^-]+)\.(\w+)\.rpm$/ ) { print "package: $1\n", "version: $2\n", "release: $3\n", "arch: $4\n"; }

•Update: made the pattern simpler and more universal
•Update: and even simpler, based on a document describing what an rpm name can look like
•Update: added explanation what the components are

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://237727]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-20 06:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found