Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'intermediate': 0.05; 'testing,': 0.07; 'subject:help': 0.07; 'subject:skip:m 10': 0.09; 'subject:string': 0.09; 'cc:addr:python-list': 0.10; 'def': 0.10; '-tkc': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'message-id:@tim.thechases.com': 0.16; 'received:70.251': 0.16; 'received:dsl.rcsntx.swbell.net': 0.16; 'received:rcsntx.swbell.net': 0.16; 'received:swbell.net': 0.16; 'wrote:': 0.17; 'tim': 0.18; 'variable': 0.20; 'import': 0.21; 'cc:no real name:2**0': 0.24; 'cc:2**1': 0.24; 'testing': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header :User-Agent:1': 0.26; 'cc:addr:gmail.com': 0.27; 'chase': 0.29; 'version': 0.34; 'subject:?': 0.35; 'rather': 0.37; 'subject:: ': 0.38; 'subject:Need': 0.61; 'times': 0.63; 'making': 0.64; 'subject:. ': 0.66; 'received:50.22': 0.84; 'to:none': 0.93 Date: Sat, 05 Jan 2013 12:49:06 -0600 From: Tim Chase User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 Subject: Re: Need a specific sort of string modification. Can someone help? References: <50E861BD.3060105@tim.thechases.com> In-Reply-To: <50E861BD.3060105@tim.thechases.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - boston.accountservergroup.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tim.thechases.com Cc: Sia , python-list@python.org 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1357411673 news.xs4all.nl 6917 [2001:888:2000:d::a6]:58201 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:36198 On 01/05/13 11:24, Tim Chase wrote: > I don't know how this version times out: > > import re > r = re.compile(r"[-+](\d+)([^-+]*)") > def modify(m): > result = m.group(2)[int(m.group(1)):] > return result Doh, I intended to change this after testing, making it just returm m.group(2)[int(m.group(1)):] rather than expending an intermediate variable I used for testing -tkc