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.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; "wouldn't": 0.11; 'dec': 0.15; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'wrote:': 0.17; '>>>': 0.18; 'question.': 0.20; 'matching': 0.23; 'needed.': 0.23; 'header:User-Agent:1': 0.26; 'wonder': 0.27; '+0100': 0.27; "doesn't": 0.28; 'header:X-Complaints-To:1': 0.28; 'reduced': 0.29; 'character': 0.29; 'true.': 0.33; 'to:addr :python-list': 0.33; 'too.': 0.35; 'there': 0.35; 'list.': 0.35; 'received:org': 0.36; 'really': 0.36; 'characters': 0.36; 'charset :us-ascii': 0.36; 'why': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'received:sd.cox.net': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: rh Subject: Re: regex walktrough Date: Sat, 8 Dec 2012 17:07:18 -0800 References: <20121208094813.5560b42fb233329a44b05dee@lavabit.com> <50C38224.3040201@mrabarnett.plus.com> <50c3cce2$0$6923$e4fe514c@news2.news.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: ip184-187-163-27.sb.sd.cox.net User-Agent: dsodnetnin X-Mailer: EZnn0.37p X-Newsreader: EZnn0.37p X-Gmane-NNTP-Posting-Host: EZnn0.37p Original-Received: from slem by 1.1 with local X-No-Archive: yes Archive: no X-Archive: expiry=11 X-Archive: encrypt X-Operating-System: Barebones_6.1 X-Gmane-NNTP-Posting-Host: 192.168.1.1 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: 29 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1355015251 news.xs4all.nl 6941 [2001:888:2000:d::a6]:51980 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:34515 On Sun, 09 Dec 2012 00:27:30 +0100 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': > > >>> 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. No and also wouldn't want to use \w unless really needed. So that answers my other question. > > -- HansM --