[Top][All Lists]

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

Re: regexp on emacs how to...

From: Thorsten Jolitz
Subject: Re: regexp on emacs how to...
Date: Mon, 01 Sep 2014 12:28:32 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

address@hidden writes:

> ok, this is a right code:
> noscenza e competenza, che in }{\rtlch\fcs1 \af0 \ltrch\fcs0 
> \f40\fs22\insrsid15731996\charrsid7868964 [-DATE-]}{\rtlch\fcs1 \af0 
> \ltrch\fcs0 \f40\fs22\insrsid15731996  prot }{\rtlch\fcs1 \af0 \ltrch\fcs0 
> \f40\fs22\insrsid15731996\charrsid13987552 [-TIME-]}{\rtlch\fcs1 \af0 
> \ltrch\fcs0 \f40\fs22\insrsid15731996  Il/la sig
> this is an example with problems
> noscenza e competenza, che in }{\rtlch\fcs1 \af0 \ltrch\fcs0 
> \f40\fs22\insrsid15731996\charrsid7868964 [-DAT{\rtlch\fcs1 \af0 
> \ltrchE-]}{\rtlch\fcs1 \af0 \ltrch\fcs0 \f40\fs22\insrsid15731996  prot 
> }{\rtlch\fcs1 \af0 \ltrch\fcs0 
> \f40\fs22\insrsid15731996\charrsid13987552 [-TI
> ME-]}{\rtlch\fcs1 \af0 \ltrch\fcs0 \f40\fs22\insrsid15731996  Il/la sig
> In the second example, my variable ([-DATE-] and [-TIME-], are interrupted:
> - in [-DATE-] variable, by rtf code
> - in [-TIME-] variable, by a a line feed
> in both example, the parser that try to substituite variable, fails,
> becausae it find some dirty text, between the start [- and the end -]
> of variable.
> So I need to detect that occurence.
> The best thing would be to detect JUST the occurence of variable that
> are not well formatted (as in example 1
> I think regexp could do that, but I don't know how...

Hmm ... when I start M-x regexp-builder and insert "\\[-[^\000]+?-]",
and then call M-x reb-force-update, all the variables in you post above
are matched. So this seems to work, but try there more profound advice
from Nicolas too.


reply via email to

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