Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!weretis.net!feeder1.news.weretis.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.016 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'subject:" ': 0.03; 'loop.': 0.09; 'subject:string': 0.09; 'pm,': 0.11; 'wrote:': 0.14; 'subject:python': 0.15; 'once,': 0.19; 'cc:no real name:2**0': 0.20; 'cc:2**0': 0.20; 'subject:list': 0.22; 'header :In-Reply-To:1': 0.22; 'cc:addr:python-list': 0.22; 'loop': 0.22; 'received:209.85.214.174': 0.23; 'received:mail- iw0-f174.google.com': 0.23; 'extract': 0.25; 'message- id:@mail.gmail.com': 0.28; 'daniel': 0.29; 'nobody': 0.29; 'sat,': 0.29; 'cc:addr:python.org': 0.31; 'match': 0.31; 'expression': 0.33; 'regular': 0.34; 'items.': 0.35; 'should': 0.37; 'received:209.85': 0.37; 'received:google.com': 0.38; 'received:209.85.214': 0.39; 'received:209': 0.39; 'header:Received:5': 0.40; 'best': 0.60; '2011': 0.62; 'subject:best': 0.93; 'to:addr:nobody': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=CYtIoxF8iYEZUQ9HNl/P5SN432xcjm1sWkLjmccPkds=; b=nTmGR0PzJHxxap9SdyB55cD6NoLVGR8HqyQy9hPngAD+Us+E6GRdLI1/KofbazQemF 5lIA2LXvigWrLKGngGmJC3wRNpTVgr4OHeqUV2pUzh+DMM+Giat2YQngneF5cGfxJmFQ Tq+LhkIXMExrfbgDWr6F1j95yg9p5UYFZ4dBY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=gvfpFRciaW5Uu+Cc7xPxls/hjnWkiHpRVwiSfjdd0R1oPN8sXbD6GN1z6Rgm3XAu52 aQUNWUNLIXnvBzlGdGCn3kQDWNEmFjbaWa7/CVQF9o/zh+oKx8FN2vnQ9Y1Yam1YEqO3 XhjEic6Jgj2tbTcF50kKs6BYq11kR6peSAfSs= MIME-Version: 1.0 In-Reply-To: References: <2efc3a05-22e5-46db-bd22-c95221bbd7b2@k16g2000yqm.googlegroups.com> Date: Sat, 14 May 2011 21:16:02 +1100 Subject: Re: How best to convert a string "list" to a python list From: Daniel Kluev To: Nobody Content-Type: text/plain; charset=ISO-8859-1 Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 9 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1305368166 news.xs4all.nl 41114 [::ffff:82.94.164.166]:45581 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:5360 On Sat, May 14, 2011 at 7:41 PM, Nobody wrote: > to use a regular expression to match everything up to the next delimiter, > and do this in a loop to extract the individual items. re.findall() should let you match all items at once, without loop. -- With best regards, Daniel Kluev