Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Regex to break up rpm filenames

by OM_Zen (Scribe)
on Feb 22, 2003 at 16:46 UTC ( #237758=note: print w/ replies, xml ) Need Help??


in reply to Regex to break up rpm filenames

Hi ,

my $filenm = "urpmi-parallel-ssh-4.0-20.1mdk.noarch.rpm"; if ($filenm =~ m/((\w+)-)+/){ ($arr,undef,$var70,undef,$var97) = split (/((?<=[a-z])\.(?=[a-z]))/,$'); local $str57 = $&; $str57 =~ s/-$//; print "[$str57]\n"; print "[$arr]\n"; print "[$var70]\n"; print "[$var97]\n"; } __END__ [urpmi-parallel-ssh] [4.0-20.lmdk] [noarch] [rpm]


This solution is through extended pattern of regular expressions . This is , I guess what you may looking for as a regular expression matching and having the answer .


Comment on Re: Regex to break up rpm filenames
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2015-07-05 23:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (68 votes), past polls