LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices

Reply
 
Search this Thread
Old 11-27-2011, 09:19 AM   #1
snmcdonald
Member
 
Registered: Jul 2011
Location: Canada
Distribution: Debian, Arch
Posts: 55

Rep: Reputation: 0
YUM w/ Perl like Regular Expressions


How can I use Perl like regex w/ YUM? I know Debian based package managers use regular expressions by default. I seem to be able to only use "wildcard" and "glob" like search expressions.

The manpage did not give an example. The CentOS and Fedora docs do not give an example and only state:

Quote:
Regular Expressions
Use Perl or Python regular expressions to carry out more complex queries.
Is there a switch/flag I need to activate? Can someone please post an example?

Last edited by snmcdonald; 11-27-2011 at 09:38 AM.
 
Old 11-27-2011, 03:01 PM   #2
jmc1987
Member
 
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7
Posts: 866

Rep: Reputation: 110Reputation: 110
http://www.centos.org/docs/5/html/yu...-packages.html
Quote:
[Tip] Regular Expressions

Use Perl or Python regular expressions to carry out more complex queries.
should have your answer
 
0 members found this post helpful.
Old 11-27-2011, 08:06 PM   #3
snmcdonald
Member
 
Registered: Jul 2011
Location: Canada
Distribution: Debian, Arch
Posts: 55

Original Poster
Rep: Reputation: 0
Unhappy

Quote:
Originally Posted by jmc1987 View Post
Unfortunately not, it just says "Use Perl or Python regular expressions to carry out more complex queries." without examples.
 
Old 11-27-2011, 08:14 PM   #4
snmcdonald
Member
 
Registered: Jul 2011
Location: Canada
Distribution: Debian, Arch
Posts: 55

Original Poster
Rep: Reputation: 0
Code:
yum list | awk '$1 ~ /^openoffice\.org-[^l].*$/ { print $1 }' | xargs yum install
-http://serverfault.com/questions/286...lar-expression

I suppose you could do something similar:

Code:
yum list | perl -ne '/regex/ && print'
-http://www.catonmat.net/blog/perl-on...ined-part-six/

It doesn't seem ideal, but it works.
 
  


Reply

Tags
yum


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
perl regular expressions arash8m Programming 3 07-13-2007 10:56 AM
Regular Expressions, Perl, everything but a / xemous Programming 6 05-22-2006 10:09 AM
Perl regular expressions CyberJedi Programming 2 10-02-2005 11:17 AM
Perl and Regular Expressions Fonk Programming 1 06-27-2004 11:32 AM
Perl Regular Expressions true_atlantis Programming 1 11-15-2003 05:16 PM


All times are GMT -5. The time now is 07:28 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration