Message from discussion
+ in regular expression
Received: by 10.181.12.101 with SMTP id ep5mr44471wid.1.1349942488451;
Thu, 11 Oct 2012 01:01:28 -0700 (PDT)
Path: q10ni65082408wif.0!nntp.google.com!feeder2.cambriumusenet.nl!feed.tweaknews.nl!216.40.29.245.MISMATCH!novia!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.glorb.com!ecngs!feeder.ecngs.de!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path: <python-python-l...@m.gmane.org>
X-Original-To: python-l...@python.org
Delivered-To: python-l...@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-l...@python.org
From: Mark Lawrence <breamore...@yahoo.co.uk>
Subject: Re: + in regular expression
Date: Thu, 04 Oct 2012 22:59:27 +0100
References: <CA+YdQ_4qK+UGjxpuzjsg3rVQfcQVLPgPB1SqP6Y+REa=OB8ZYQ@mail.gmail.com>
Mime-Version: 1.0
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: <CA+YdQ_4qK+UGjxpuzjsg3rVQfcQVLPgPB1SqP6Y+REa=OB8ZYQ@mail.gmail.com>
X-Antivirus: avast! (VPS 121003-1, 03/10/2012), Outbound message
X-Antivirus-Status: Clean
X-BeenThere: python-l...@python.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <http://mail.python.org/mailman/options/python-list>,
<mailto:python-list-requ...@python.org?subject=unsubscribe>
List-Archive: <http://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-l...@python.org>
List-Help: <mailto:python-list-requ...@python.org?subject=help>
List-Subscribe: <http://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-requ...@python.org?subject=subscribe>
Newsgroups: comp.lang.python
Message-ID: <mailman.1829.1349400636.27098.python-l...@python.org>
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: ab...@xs4all.nl
Bytes: 3528
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
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 "<stdin>", line 1, in <module>
> 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.