From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thorsten Jolitz Newsgroups: gmane.emacs.help Subject: Re: regexp question: match anything but not a group? Date: Fri, 04 Apr 2014 10:53:23 +0200 Message-ID: <87k3b5pjb0.fsf@gmail.com> References: <87zjk4louc.fsf@gmail.com> <533BA65E.3030408@easy-emacs.de> <874n2ai4ta.fsf@gmail.com> <533E5326.5080900@easy-emacs.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1396601575 24528 80.91.229.3 (4 Apr 2014 08:52:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 4 Apr 2014 08:52:55 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Apr 04 10:52:50 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 1WVzrl-0001QB-5b for geh-help-gnu-emacs@m.gmane.org; Fri, 04 Apr 2014 10:52:49 +0200 Original-Received: from localhost ([::1]:48531 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVzrk-0003fE-Su for geh-help-gnu-emacs@m.gmane.org; Fri, 04 Apr 2014 04:52:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36965) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVzrL-0003Xy-7m for help-gnu-emacs@gnu.org; Fri, 04 Apr 2014 04:52:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WVzrD-0007Sk-6M for help-gnu-emacs@gnu.org; Fri, 04 Apr 2014 04:52:23 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:38132) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVzrC-0007R1-Td for help-gnu-emacs@gnu.org; Fri, 04 Apr 2014 04:52:15 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WVzrB-0000ur-EM for help-gnu-emacs@gnu.org; Fri, 04 Apr 2014 10:52:13 +0200 Original-Received: from g231232070.adsl.alicedsl.de ([92.231.232.70]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 04 Apr 2014 10:52:13 +0200 Original-Received: from tjolitz by g231232070.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 04 Apr 2014 10:52:13 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 39 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: g231232070.adsl.alicedsl.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:SW5V+B208G0IGGngnMfz4idIIuo= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:96969 Archived-At: Andreas Röhler writes: > Am 03.04.2014 21:36, schrieb Thorsten Jolitz: >> Andreas Röhler writes: >> >>> Am 01.04.2014 23:30, schrieb Thorsten Jolitz: >>>> >>>> Hi List, >>>> >>>> how can I write a regexp that acts like e.g. >>>> >>>> ,------ >>>> | ".*?" >>>> `------ >>>> >>> >>> BTW looks wrong. .* might much nothing, if non-greedy it remains >>> nothing (?) >> >> But it still seems valid to protect against greedyness? >> > > Coming upon evaluating this, cursor at start of "asdf": > > (progn (looking-at ".*")(message (match-string-no-properties 0)))asdf > > ==> asdf > > (progn (looking-at ".*?")(message (match-string-no-properties 0)))asdf > > ==> "" Yes, it seems you are right ... so this is actually always wrong? Thanks for the tip ... -- cheers, Thorsten