From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: PJ Weisberg Newsgroups: gmane.emacs.help Subject: Re: Quickie - Regexp for a string not at the beginning of the line Date: Thu, 25 Oct 2012 19:19:11 -0700 Message-ID: References: <9eba5652-f814-41fa-83e4-460bca2be264@n16g2000yqi.googlegroups.com> <73f60cf3-d932-4366-a405-6767488560c6@q16g2000yqc.googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d04374a0708bdda04ccecf2e1 X-Trace: ger.gmane.org 1351217960 10673 80.91.229.3 (26 Oct 2012 02:19:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Oct 2012 02:19:20 +0000 (UTC) Cc: "help-gnu-emacs@gnu.org" To: Rivka Miller Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Oct 26 04:19:29 2012 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 1TRZWC-0006Mf-OC for geh-help-gnu-emacs@m.gmane.org; Fri, 26 Oct 2012 04:19:28 +0200 Original-Received: from localhost ([::1]:37424 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRZW4-0005Ew-Ot for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Oct 2012 22:19:20 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56718) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRZVy-0005Dv-Jc for help-gnu-emacs@gnu.org; Thu, 25 Oct 2012 22:19:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TRZVx-00004y-G6 for help-gnu-emacs@gnu.org; Thu, 25 Oct 2012 22:19:14 -0400 Original-Received: from mail-wg0-f49.google.com ([74.125.82.49]:47626) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRZVx-0008WU-9n for help-gnu-emacs@gnu.org; Thu, 25 Oct 2012 22:19:13 -0400 Original-Received: by mail-wg0-f49.google.com with SMTP id gg4so1303490wgb.30 for ; Thu, 25 Oct 2012 19:19:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=xsbwB1qpebNs4AJAbP8sM30p2iKP3LqCQeiTTz5UZmE=; b=AYsGrH72PzgjE5YQ3taPNtZH4X7zkh9CDeaV/ZbUCOzoltGfVP+YIqTciXaIXdEuCt xLIHVqipa9BEY7H25JhdQQPAGGL07pUKKVcF4uhdU7+Yf2aO0S5gIsg13YttHzDSvnvs jkeswBmeLRMveRUpS0Ra4f4dv708UJkvSWnfqeA1NFonRJ/bDvlXRViIm8MDlYeOFzIi IdkCa3nyngsAtDuQoDHsq3pzDs0IBOySrx7cGfT/4tzcYqhT7ZqPIOACEajhT+gJZWzN UyZjte0nW7MacriDrf1D8sqoPRrMq0tnHzUi4ohtXHAmR3/zXjKWo0UIr1p5vJV2Smrq Hs9w== Original-Received: by 10.180.91.71 with SMTP id cc7mr1704412wib.2.1351217951849; Thu, 25 Oct 2012 19:19:11 -0700 (PDT) Original-Received: by 10.194.61.129 with HTTP; Thu, 25 Oct 2012 19:19:11 -0700 (PDT) In-Reply-To: <73f60cf3-d932-4366-a405-6767488560c6@q16g2000yqc.googlegroups.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.82.49 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:87430 Archived-At: --f46d04374a0708bdda04ccecf2e1 Content-Type: text/plain; charset=ISO-8859-1 On Thursday, October 25, 2012, Rivka Miller wrote: > Hello Programmers, > > I am looking for a regexp for a string not at the beginning of the > line. > > For example, I want to find $hello$ that does not occur at the > beginning of the string, ie all $hello$ that exclude ^$hello$. How about a zero-width lookbehind for any character? -- -PJ Gehm's Corollary to Clark's Law: Any technology distinguishable from magic is insufficiently advanced. --f46d04374a0708bdda04ccecf2e1 Content-Type: text/html; charset=ISO-8859-1 On Thursday, October 25, 2012, Rivka Miller <rivkaumiller@gmail.com> wrote:

> Hello Programmers,
>
> I am looking for a regexp for a string not at the beginning of the
> line.
>
> For example, I want to find $hello$ that does not occur at the
> beginning of the string, ie all $hello$ that exclude ^$hello$.

How about a zero-width lookbehind for any character?

--
-PJ

Gehm's Corollary to Clark's Law: Any technology distinguishable from
magic is insufficiently advanced.
--f46d04374a0708bdda04ccecf2e1--