Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!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.017 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; '(unicode': 0.07; 'python': 0.09; "wouldn't": 0.11; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'message- id:@mrabarnett.plus.com': 0.16; 'time).': 0.16; 'unicode.': 0.16; 'wrote:': 0.17; 'unicode': 0.17; 'matching': 0.23; 'header:In- Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'supported': 0.26; 'wonder': 0.27; "doesn't": 0.28; '>>>>': 0.29; 'received:192.168.1.3': 0.29; 'reduced': 0.29; 'character': 0.29; 'evolving': 0.33; 'true.': 0.33; 'to:addr:python-list': 0.33; 'version': 0.34; 'too.': 0.35; 'there': 0.35; 'list.': 0.35; 'characters': 0.36; 'depends': 0.36; 'being': 0.37; 'why': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'where': 0.40; 'received:192.168': 0.40; 'header:Reply-To:1': 0.68; 'reply-to:no real name:2**0': 0.72; 'reply-to:addr:python.org': 0.84 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.0 cv=dNckaZlb c=1 sm=1 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=O2Kvzccb_dQA:10 a=ihvODaAuJD4A:10 a=OUOv7kDek9cA:10 a=8nJEP1OIZ-IA:10 a=EBOSESyhAAAA:8 a=8AHkEIZyAAAA:8 a=7Gjc_PwvzGwA:10 a=f6xlawOtUR1mY3o5Uh8A:9 a=wPNLvfGTeEIA:10 a=Z03hDlHPZ1nrBF_O:21 a=TVLRDhuauZ5NYqIT:21 a=0nF1XD0wxitMEM03M9B4ZQ==:117 X-AUTH: mrabarnett:2500 Date: Sun, 09 Dec 2012 00:56:37 +0000 From: MRAB User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: regex walktrough References: <20121208094813.5560b42fb233329a44b05dee@lavabit.com> <50C38224.3040201@mrabarnett.plus.com> <50c3cce2$0$6923$e4fe514c@news2.news.xs4all.nl> In-Reply-To: <50c3cce2$0$6923$e4fe514c@news2.news.xs4all.nl> 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 Reply-To: python-list@python.org 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: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1355014599 news.xs4all.nl 6989 [2001:888:2000:d::a6]:44123 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:34512 On 2012-12-08 23:27, Hans Mulder wrote: > On 8/12/12 23:19:40, rh wrote: >> I reduced the expression too. Now I wonder why re.DEBUG doesn't unroll >> category_word. Some other re flag? > > he category word consists of the '_' character and the > characters for which .isalnum() return True. > > On my system there are 102158 characters matching '\w': > That would be because you're using Python 3, where strings are Unicode. >>>> sum(1 for i in range(sys.maxunicode+1) > ... if re.match(r'\w', chr(i))) > 102158 >>>> > > You wouldn't want to see the complete list. > The number of such codepoints depends on which version of Unicode is being supported (Unicode is evolving all the time).