Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed5.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.029 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'matches': 0.07; 'purpose.': 0.07; 'throws': 0.09; 'jain': 0.16; 'multiples': 0.16; 'oct': 0.16; 'subject:expression': 0.16; 'subject:regular': 0.16; 'wrote:': 0.17; 'thu,': 0.17; 'error.': 0.21; 'header:In-Reply- To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; 'to:addr:python- list': 0.33; 'received:google.com': 0.34; 'pm,': 0.35; 'received:209.85': 0.35; 'why': 0.37; 'received:209': 0.37; 'some': 0.38; 'instead': 0.39; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'first': 0.61; 'more': 0.63; 'six': 0.65; 'food': 0.71; 'to:name:python': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=SFl4O21zGLc9k4aSF5AH+THbpylqhbYeBDELEb6w4dc=; b=zPDpkKiJuIVLmyABNgFDqnwCK1N+E5cxdHgHQkjZDoVYxFENeRksjmAtIgGoCfCsZX mn2vNycaPxKIPTHeZRb5+3qWijekmAgYZFy5/xE0MHtn2ukvctQRzp7UCScMTzcG8UED pxdlA8glF4+XaAbQWu0clJcHwkffYnZuk2/qRqaEuMtgmYZFAMbjurwRx5F+3KhL27gU WxjAvCnS8NyROEyk6GEKY+2/AUs+A3xK6M6w2pRU5aB8PZdBbXwwdgZCJQh6i6GPizUg So73Xk00veqCtqDmiWkZKQw6lIchOS27ghq3bblBpubsNWr4AmUwYaItiAYrk7oY3aWc Xjow== MIME-Version: 1.0 In-Reply-To: <9824145E4C0B6C4A94BEF7CE7692E808199E4064@BLRKECMBX22.ad.infosys.com> References: <9824145E4C0B6C4A94BEF7CE7692E808199E4064@BLRKECMBX22.ad.infosys.com> From: Ian Kelly Date: Thu, 4 Oct 2012 23:14:13 -0600 Subject: Re: + in regular expression To: Python Content-Type: text/plain; charset=ISO-8859-1 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: 9 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1349414085 news.xs4all.nl 6955 [2001:888:2000:d::a6]:44140 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:30780 On Thu, Oct 4, 2012 at 9:44 PM, Saroo Jain wrote: > x3=re.match("\s{6}+",str) > > instead use > x3=re.match("\s{6,}",str) > > This serves the purpose. And also give some food for thought for why the first one throws an error. That matches six or more spaces, not multiples of six spaces.