Path: csiph.com!usenet.pasdenom.info!news.albasani.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:string': 0.09; 'subject:not': 0.11; 'programmers,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'silly': 0.16; 'string': 0.17; 'wrote:': 0.17; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; 'header:X-Complaints-To:1': 0.28; "skip:' 10": 0.30; 'e.g.': 0.30; 'from:addr:yahoo.co.uk': 0.32; "skip:' 20": 0.32; 'to:addr:python-list': 0.33; 'received:org': 0.36; 'why': 0.37; 'subject:: ': 0.38; 'mark': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'miller': 0.69 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: Quickie - Regexp for a string not at the beginning of the line Date: Fri, 26 Oct 2012 03:37:23 +0100 References: <9eba5652-f814-41fa-83e4-460bca2be264@n16g2000yqi.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-78-147-31-98.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 In-Reply-To: <9eba5652-f814-41fa-83e4-460bca2be264@n16g2000yqi.googlegroups.com> X-Antivirus: avast! (VPS 121025-2, 25/10/2012), Outbound message X-Antivirus-Status: Clean X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1351218871 news.xs4all.nl 6890 [2001:888:2000:d::a6]:48395 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:32186 On 25/10/2012 21:53, Rivka Miller wrote: > Hello Programmers, > > I am looking for a regexp for a string not at the beginning of the > line. > Why bother with a silly regex thingy when simple string methods will suffice e.g. 'yourstring'.find('xyz', 1) or 'yourstring'.index('xyz', 1) or 'xyz' in 'yourstring'[1:] -- Cheers. Mark Lawrence.