Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.013 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'booth': 0.09; 'sentence': 0.09; ':-)': 0.13; 'language': 0.14; '*you*': 0.16; 'driscoll': 0.16; 'regex,': 0.16; 'say.': 0.16; 'still,': 0.16; 'subject:expression': 0.16; 'subject:regular': 0.16; 'wrote:': 0.17; 'element': 0.17; 'followed': 0.20; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'am,': 0.27; 'guess': 0.27; 'regular': 0.27; 'rest': 0.28; 'post': 0.28; 'usually': 0.30; '(and': 0.32; 'says': 0.33; 'to:addr:python-list': 0.33; 'mine': 0.35; 'received:192.168.0': 0.35; 'something': 0.35; "didn't": 0.36; 'should': 0.36; 'ok,': 0.37; 'two': 0.37; 'quite': 0.37; 'nothing': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'your': 0.60; 'first': 0.61; 'fact,': 0.69; 'received:192.168.0.3': 0.84 Date: Fri, 05 Oct 2012 10:31:26 -0500 From: Evan Driscoll User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: + in regular expression References: <506EFC44.40508@cs.wisc.edu> In-Reply-To: <506EFC44.40508@cs.wisc.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1349451071 news.xs4all.nl 6895 [2001:888:2000:d::a6]:54056 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:30822 On 10/05/2012 10:27 AM, Evan Driscoll wrote: > On 10/05/2012 04:23 AM, Duncan Booth wrote: >> A regular expression element may be followed by a quantifier. >> Quantifiers are '*', '+', '?', '{n}', '{n,m}' (and lazy quantifiers >> '*?', '+?', '{n,m}?'). There's nothing in the regex language which says >> you can follow an element with two quantifiers. > In fact, *you* did -- the first sentence of that paragraph! :-) > > \s is a regex, so you can follow it with a quantifier and get \s{6}. > That's also a regex, so you should be able to follow it with a > quantifier. OK, I guess this isn't true... you said a "regular expression *element*" can be followed by a quantifier. I just took what I usually see as part of a regular expression and read into your post something it didn't quite say. Still, the rest of mine applies. Evan