From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nicolas Richard Newsgroups: gmane.emacs.help Subject: Re: regexp on emacs how to... Date: Mon, 01 Sep 2014 11:56:56 +0200 Message-ID: <8761h764uv.fsf@geodiff-mac3.ulb.ac.be> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1409565311 24201 80.91.229.3 (1 Sep 2014 09:55:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Sep 2014 09:55:11 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: renato.pontefice@gmail.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Sep 01 11:55:04 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XOOKF-0008Oh-U1 for geh-help-gnu-emacs@m.gmane.org; Mon, 01 Sep 2014 11:55:04 +0200 Original-Received: from localhost ([::1]:59018 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOOKF-0004rB-Iv for geh-help-gnu-emacs@m.gmane.org; Mon, 01 Sep 2014 05:55:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51412) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOOJr-0004qy-G7 for help-gnu-emacs@gnu.org; Mon, 01 Sep 2014 05:54:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOOJk-0005sR-0W for help-gnu-emacs@gnu.org; Mon, 01 Sep 2014 05:54:39 -0400 Original-Received: from mxin.ulb.ac.be ([164.15.128.112]:47547) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOOJj-0005sD-Nr for help-gnu-emacs@gnu.org; Mon, 01 Sep 2014 05:54:31 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqEKAJVBBFSkD4Xx/2dsb2JhbABZhDevFAEBAQEBAQagLwGBMneEBAEFeRALISUPAQQNT4gtAQMRpmWMKwFKDYVlAReFfIIihQKCLQcWhDYBBJpMiS+HSIY3g2M7L4JPAQEB Original-Received: from mathsrv4.ulb.ac.be (HELO geodiff-mac3.ulb.ac.be) ([164.15.133.241]) by smtp.ulb.ac.be with ESMTP; 01 Sep 2014 11:54:29 +0200 In-Reply-To: (renato pontefice's message of "Sat, 30 Aug 2014 14:01:02 -0700 (PDT)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.93 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 164.15.128.112 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:99555 Archived-At: renato.pontefice@gmail.com 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") (recursive-edit))) 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. HTH, -- Nicolas Richard