Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.news-service.com!xlned.com!feeder5.xlned.com!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.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'python,': 0.01; 'perl,': 0.05; 'php,': 0.09; 'pm,': 0.10; 'wrote:': 0.14; 'angelico': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'roy': 0.16; 'transmit': 0.16; '\xa0you': 0.16; "wouldn't": 0.17; 'situation.': 0.19; 'header:In-Reply-To:1': 0.21; 'compared': 0.22; 'file,': 0.22; 'received:209.85.210.174': 0.23; 'received :mail-iy0-f174.google.com': 0.23; 'match': 0.26; 'string': 0.26; "i'm": 0.27; 'message-id:@mail.gmail.com': 0.28; '(as': 0.29; 'sat,': 0.29; 'subject:how': 0.29; 'config': 0.30; 'done': 0.32; 'to:addr:python-list': 0.33; 'asking': 0.33; 'chris': 0.34; 'however,': 0.34; 'store': 0.35; 'connection': 0.37; 'received:google.com': 0.37; 'received:209.85': 0.37; 'another': 0.37; 'put': 0.37; 'but': 0.38; 'third': 0.38; 'subject:: ': 0.38; 'unless': 0.39; 'received:209': 0.39; 'to:addr:python.org': 0.39; 'header': 0.40; 'below': 0.61; 'ever': 0.64; '12:30': 0.84; 'condition,': 0.84; 'methods)': 0.84; 'transmitting': 0.84 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:content-type:content-transfer-encoding; bh=hJRIBACeWRGlDUH1P6g+irBdgccvvQc1D38QzZU3Cdo=; b=DBNujO7myGQEULKMKP4uoa5G4vxboBq0ibwPC94gDMN4BVgGaEWJYsCIH8SERFopxd FHU/RSG1vkBh7uTed/3kHD+HurCKyvFwal7HM8QGfpivNbyoxkXDd2LAfV3ndrD/C0HV aM8seozamqqkudSvmI711wy0658EyZIoeVlL4= 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 :content-type:content-transfer-encoding; b=mZUGgcdHQeCvjFIHG4MyKmt46Hn2k5P7MfYxhUci3lZ/rBhi+iAkpDYbBHpE0oGpqR kef9wltcKPN9FbMijSTZSTHnc4zIfXIO1eAEznHTxl8pzMVUbz2BUBwKJIgh+gIizaGA r/klBgX+IX6O2/56XLFo7RRevAqDLj3AsWD+0= MIME-Version: 1.0 In-Reply-To: References: <9e861b0e-e768-401b-b5ca-190f20830a08@s9g2000yqm.googlegroups.com> <94ph22FrhvU5@mid.individual.net> <4de8eef1$0$29996$c3e8da3$5496439d@news.astraweb.com> <1237a287-10b0-4a2d-ba35-97b5238deda1@n11g2000yqf.googlegroups.com> <4de992d7$0$29996$c3e8da3$5496439d@news.astraweb.com> Date: Sat, 4 Jun 2011 16:04:18 +1000 Subject: Re: how to avoid leading white spaces From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 18 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1307167467 news.xs4all.nl 49038 [::ffff:82.94.164.166]:47249 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:6998 On Sat, Jun 4, 2011 at 12:30 PM, Roy Smith wrote: > Another nice thing about regexes (as compared to string methods) is that > they're both portable and serializable. =A0You can use the same regex in > Perl, Python, Ruby, PHP, etc. =A0You can transmit them over a network > connection to a cooperating process. =A0You can store them in a database > or a config file, or allow users to enter them on the fly. > I wouldn't ever be transmitting them around the place, unless also allowing users to enter them. But I have done exactly that - a validator system that lets you put a header with a regex, and then string content below that. That IS one advantage of the regex. However, that's a very VERY specific situation. If I'm not asking a third party to provide the match condition, then that's not a reason to go regex. Chris Angelico