[Top][All Lists]

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

Re: regexp on emacs how to...

From: Nicolas Richard
Subject: Re: regexp on emacs how to...
Date: Mon, 01 Sep 2014 11:56:56 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.93 (gnu/linux)

address@hidden writes:
> I would have a regexp that show me any occurence of this tag, where i.e.:
> - there are open tag [-
> - name of variable [-VARIABLENAME
>  but the close tag -] are after a line break

Do you really need to do it with a regexp ? Here's some lisp to search
for all these problematic tags.

(while (and (not (eobp)) (search-forward "[-" nil t))
  (unless (search-forward "-]" (point-at-eol) 'move)
     (message "Problem found, please fix and hit C-M-c to continue")

If you really want a regexp, you could use
(re-search-forward "\\[-\\([^-]\\|-[^]]\\)*\n")

(i.e. match a "[-" not followed by "-]" on the same line)

At the C-M-% prompt, you can enter the regexp as \[-\([^-]\|-[^]]\)* followed 
by a
litteral newline, i.e. C-q C-j.


Nicolas Richard

reply via email to

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