[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sr #104682] files whose content matches all given regular expressions
From: |
anonymous |
Subject: |
[sr #104682] files whose content matches all given regular expressions |
Date: |
Fri, 23 Sep 2005 15:33:43 +0000 |
User-agent: |
Mozilla/4.0 (compatible; MSIE 5.5; WinNT) |
URL:
<http://savannah.gnu.org/support/?func=detailitem&item_id=104682>
Summary: files whose content matches all given regular
expressions
Project: grep
Submitted by: None
Submitted on: ven 23.09.2005 à 15:33
Category: None
Priority: 5 - Normal
Severity: 1 - Wish
Status: None
Privacy: Public
Assigned to: None
Originator Email: address@hidden
Open/Closed: Open
Platform Version: None
_______________________________________________________
Details:
Hi,
There is sometimes a need to find all files which contain
several words (in any order, possibly lying on different lines)
(printing matching lines or not).
I think (am i wrong) that this cannot be done with *grep.
Could it be interesting to add that option to egrep ?
I am enclosing a working Perl script as demo.
e.g.
# mgrep -i gnu author ++ *.c *.h
will retrieve all source files that contain somewhere
the words "gnu" and "author".
This could be implemented as an option (like -a -- "AND")
which will consider words delimitated by bars in regexp
or from an external source (-f) as combined.
Best regards
and thanks you all GNU gurus !
Phil Astiers - address@hidden
_______________________________________________________
Carbon-Copy List:
CC Address | Comment
------------------------------------+-----------------------------
p64 --À-- free --POINT-- fr | Originator Email
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: ven 23.09.2005 à 15:33 Name: mgrep.pl Size: 1,94Ko By: None
perl code
<http://savannah.gnu.org/support/download.php?item_id=104682&item_file_id=163>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/support/?func=detailitem&item_id=104682>
_______________________________________________
Message posté via/par Savannah
http://savannah.gnu.org/
- [sr #104682] files whose content matches all given regular expressions,
anonymous <=