From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "akaiser@visi.com" Newsgroups: gmane.emacs.help Subject: Re: Stack overflow in regexp matcher Date: Thu, 17 Dec 2009 23:13:51 +0100 Message-ID: <4B2AAD1F.10804@visi.com> References: <8u-dncYjy6Q3iLTWnZ2dnUVZ8nKdnZ2d@posted.visi> Reply-To: akaiser@visi.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1261100380 28373 80.91.229.12 (18 Dec 2009 01:39:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Dec 2009 01:39:40 +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 Dec 18 02:39:33 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NLRob-0007Oe-AM for geh-help-gnu-emacs@m.gmane.org; Fri, 18 Dec 2009 02:39:33 +0100 Original-Received: from localhost ([127.0.0.1]:36244 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NLRob-0003dc-1p for geh-help-gnu-emacs@m.gmane.org; Thu, 17 Dec 2009 20:39:33 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!news.glorb.com!news2.glorb.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.posted.visi!news.posted.visi.POSTED!not-for-mail Original-NNTP-Posting-Date: Thu, 17 Dec 2009 16:13:51 -0600 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 Original-Newsgroups: gnu.emacs.help In-Reply-To: Original-Lines: 18 X-Usenet-Provider: http://www.giganews.com Original-NNTP-Posting-Host: 81.221.218.109 Original-X-Trace: sv3-tdPVo9W4VE3P5KGQozMGtF8Dy2CWzSCr61zPjm0fje2MuyMomCQbmSPC/TvhDGs/AWiLpA3VuG0yN07!b7yWo8ElXXIKD6ZcCUfe5AQ9QD0FON1m2e0zJ/e8iUHxJymCfC8xCdA2W8HO Original-X-Complaints-To: abuse@visi.com X-DMCA-Complaints-To: abuse@visi.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 Original-Xref: news.stanford.edu gnu.emacs.help:175639 X-Mailman-Approved-At: Thu, 17 Dec 2009 20:25:51 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:70722 Archived-At: Barry Margolin wrote: > The problem is that + is greedy, so this has to scan the entire line > looking for the last "]", then see if there's an "=" somewhere later. > If it can't find an "=" it has to back up to the previous "]" and search > again, and so on. If there are lots of "]" characters, this has to save > the state of each of them in the matching stack. That's what I first suspected too. But (a) the same thing happens with "^< \\([^]]+].+=|\\)" which constrains the search to find only the first "]", and (b) there's only one "]" in that line -- within the first 45 characters -- as well as only a single "=|". Any other thoughts? djc