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

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

How, in a QUERY-REPLACE-regexp, to match a RANGE of lines?


From: David Combs
Subject: How, in a QUERY-REPLACE-regexp, to match a RANGE of lines?
Date: 17 Feb 2010 15:22:19 -0500

subj: How, in a QUERY-REPLACE-regexp, to match a RANGE of lines?



Like from a line containing xxx up through the nearest one containing yyy?


Totally separate question:

(Any easy way to give error msg if you see another xxx-line before
that yyy? -- other than by explicit loop looking at each line and
remembering what it saw?)


Or do you have to write an explicit loop -- checking each individual
line, remembering what you've seen so far (eg, xxx), etc.

In elisp, how would you do that?


Thanks,

David

PS: reason for this: I've got a bunch of Amazon reviews (hundreds
of them), each containing these six lines:


 | Help other customers find the most helpful reviews  
 | Was this review helpful to you?  Yes No
 |      
 |      
 | Report this | Permalink
 | Comment Comment



But, now and then, I might have already removed any 
one or more of them.  So I got to make sure it's as
I think it is.


Any way to recognize those six lines with ONE regexp?





reply via email to

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