Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.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.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'question?': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:expression': 0.16; 'subject:regular': 0.16; 'wrote:': 0.17; '"",': 0.22; 'raise': 0.24; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'skip:" 20': 0.26; '(most': 0.27; 'regular': 0.27; 'header:X-Complaints-To:1': 0.28; '>>>>': 0.29; 'skip:_ 10': 0.29; 'file': 0.32; 'from:addr:yahoo.co.uk': 0.32; 'traceback': 0.33; 'to:addr:python-list': 0.33; 'posting': 0.35; 'received:org': 0.36; 'too': 0.36; 'why': 0.37; 'mark': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'repeat': 0.62 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: + in regular expression Date: Thu, 04 Oct 2012 22:59:27 +0100 References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-92-24-211-174.ppp.as43234.net User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 In-Reply-To: X-Antivirus: avast! (VPS 121003-1, 03/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: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1349400636 news.xs4all.nl 6878 [2001:888:2000:d::a6]:56759 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:30769 On 04/10/2012 04:01, contro opinion wrote: >>>> str=" gg" >>>> x1=re.match("\s+",str) >>>> x1 > <_sre.SRE_Match object at 0xb7354db0> >>>> x2=re.match("\s{6}",str) >>>> x2 > <_sre.SRE_Match object at 0xb7337f38> >>>> x3=re.match("\s{6}+",str) > Traceback (most recent call last): > File "", line 1, in > File "/usr/lib/python2.6/re.py", line 137, in match > return _compile(pattern, flags).match(string) > File "/usr/lib/python2.6/re.py", line 245, in _compile > raise error, v # invalid expression > sre_constants.error: multiple repeat >>>> > > why the "\s{6}+" is not a regular pattern? > > > Why are you too lazy to do any research before posting a question? -- Cheers. Mark Lawrence.