in reply to regex for rpm: name, version, release, arch
Output:#!/usr/bin/perl use warnings; use strict; use Text::Table; my $tb = Text::Table->new(qw/NAME VERSION RELEASE ARCH/); while(<DATA>) { $tb->load( [ /^(.*)-(.*)-(.*)\.(.*)$/ ] ); } print $tb; __DATA__ fipscheck-1.2.0-1.el5.x86_64 iptables-ipv6-1.3.5-5.3.el5_4.1.x86_64 libXi-1.0.1-4.el5_4.i386 perl-Carp-Clan-5.3-1.2.1.noarch rpm-build-4.6.1-2.el5.x86_64
NAME VERSION RELEASE ARCH fipscheck 1.2.0 1.el5 x86_64 iptables-ipv6 1.3.5 5.3.el5_4.1 x86_64 libXi 1.0.1 4.el5_4 i386 perl-Carp-Clan 5.3 1.2.1 noarch rpm-build 4.6.1 2.el5 x86_64
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: regex for rpm: name, version, release, arch
by Anonymous Monk on Aug 31, 2012 at 15:06 UTC |