help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: RegExp: match everything except a certain string


From: Sven Bretfeld
Subject: Re: RegExp: match everything except a certain string
Date: Tue, 20 Nov 2007 21:36:00 +0100
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1.50 (gnu/linux)

Hello Andreas

Andreas Röhler <andreas.roehler@online.de> writes:

>>  author = {somename},
>>  editor = {},
>>  title = {sometitle},
>>  subtitle = {},
>>  series = {},
>>  url = {}
>>
>> I want to find a regexp that matches every line with empty {} except
>> of the "subtitle line". I've come that far:
>>
> Got it with:
>
> [^s]?[^u]?[^b]?[^t]?[^i]?[^t]?[^l]?[^e] = {},?$
>
> Please don't ask why :)

That's working. Thanks. (I don't ask.)

> Anyway--you will know that and it's not the precise
> answer-- it might be useful to point at
>
> M-x shell-command-on-region
>
> grep {} | sed /subtitle/d
>
> as an easy-to-use solution.

It's a good idea to use a sed pipe. But it doesn't matter how much
there is to type, since I need the expression for a function. So I
only have to type it once.

Greetings

Sven

Attachment: pgprr6QagzJiq.pgp
Description: PGP signature


reply via email to

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