Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!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.012 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'expressions': 0.07; 'python': 0.09; 'expectation': 0.09; 'explanation': 0.09; 'lawrence': 0.09; 'question?': 0.09; 'looked': 0.10; '(well,': 0.16; 'extensions,': 0.16; 'subject:expression': 0.16; 'subject:regular': 0.16; 'wrote:': 0.17; 'module': 0.19; 'work.': 0.23; 'mention': 0.23; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; 'question': 0.27; 'regular': 0.27; "doesn't": 0.28; 'surprised': 0.29; 'whitespace': 0.29; "i'm": 0.29; 'stuff': 0.30; '(and': 0.32; 'to:addr:python-list': 0.33; 'languages': 0.33; "can't": 0.34; 'sequence': 0.35; 'expected': 0.35; 'pm,': 0.35; 'posting': 0.35; 'received:192.168.0': 0.35; 'really': 0.36; 'explain': 0.36; 'but': 0.36; 'characters': 0.36; "didn't": 0.36; 'anything': 0.36; 'too': 0.36; 'beyond': 0.37; 'ok,': 0.37; 'being': 0.37; 'why': 0.37; 'subject:: ': 0.38; 'mark': 0.38; 'several': 0.39; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'google': 0.39; 'received:192.168': 0.40; 'repeat': 0.62; 'provide': 0.62; 'results': 0.65; 'it"': 0.84; 'received:192.168.0.3': 0.84 Date: Thu, 04 Oct 2012 21:25:40 -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: Re: + in regular expression References: In-Reply-To: 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: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1349404871 news.xs4all.nl 6870 [2001:888:2000:d::a6]:39337 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:30775 On 10/04/2012 04:59 PM, Mark Lawrence wrote: >> why the "\s{6}+" is not a regular pattern? >> >> >> > > > Why are you too lazy to do any research before posting a question? > Errr... what? I'm only somewhat familiar with the extra stuff that languages provide in their regexs beyond true regular expressions and simple extensions, but I was surprised to see the question because I too would have expected that to work. (And match any sequence of whitespace characters whose length is a multiple of six.) I reskimmed the documentation of the re module and didn't see anything that would prohibit it. I looked at several of the results of a Google search for the multiple repeat error, and didn't really find any explanation beyond "because you can't do it" or "here's a regex that works." (Well, OK, I did see a mention of + being a possessive quantifier which Python doesn't support. But that still doesn't explain why my expectation isn't what happened.) In what way is that an unreasonable question? Evan