gnu-regexp-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Regexp] a regexp question


From: Hartwig, Thomas
Subject: Re: [Regexp] a regexp question
Date: Fri, 07 May 2004 20:30:43 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113

Forget my second email, this was a silly one. Of course you could do something like grep -v "puppy.*kitty" always without sed, but that is not a fine regex of course.

Thomas

Hartwig, Thomas wrote:
If you have a sort of unix this one could help you:

sed 's/puppy.*kitty/§§§/' | grep -v "§§§"

§§§ is just a sample.

Thomas

Levent Yilmaz wrote:

Hello,

It sounded like a very simple problem but I couldn't come up with a solution. I was trying to do this with Basic Regexp in grep:

Find all lines which contain the word 'kitty'. But only those lines that do not have 'puppy' somewhere before 'kitty'. For instance:

my kitty is very cute
but puppy is cuter than kitty

What regular expression stands for the first line but not the second? Note that the other way is very easy, that is the lines with 'puppy' followed by 'kitty': puppy.*kitty

thank you so very much!
-Levent.


PS: What is all this spam on the list by the way?



_______________________________________________
Gnu-regexp-users mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/gnu-regexp-user

s

_______________________________________________
Gnu-regexp-users mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/gnu-regexp-users

Attachment: t.hartwig.vcf
Description: Vcard


reply via email to

[Prev in Thread] Current Thread [Next in Thread]