Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #5314

Re: Regular Expression for words (with umlauts, without numbers)

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!selfless.tophat.at!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python@mrabarnett.plus.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'url:bugs': 0.07; 'python': 0.07; 'url:pypi': 0.09; 'from:addr:python': 0.09; 'integers': 0.09; 'wrote:': 0.14; '2.7:': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:name:mrab': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'received:84.92': 0.16; 'received:84.92.122': 0.16; 'received:84.92.122.60': 0.16; 'received:84.93': 0.16; 'received:84.93.230': 0.16; 'regexp': 0.16; 'reply-to:addr:python-list': 0.16; 'underscore.': 0.16; 'header:In-Reply-To:1': 0.22; 'minutes,': 0.23; 'module,': 0.23; 'moreover,': 0.23; 'received:84': 0.25; 'like,': 0.29; 'unicode': 0.29; 'however,': 0.31; 'to:addr:python-list': 0.32; 'uses': 0.34; 'actually': 0.34; 'header:User-Agent:1': 0.35; 'flag': 0.35; 'like:': 0.35; 'reply-to:addr:python.org': 0.35; 'url:python': 0.37; 'exactly': 0.37; 'subject:with': 0.37; 'url:org': 0.38; 'so,': 0.38; 'current': 0.38; 'tim': 0.39; 'to:addr:python.org': 0.39; 'subject: (': 0.39; 'except': 0.39; 'here:': 0.61; 'grab': 0.65; 'reply-to:no real name:2**0': 0.72; 'header:Reply-To:1': 0.72
X-IronPort-Anti-Spam-Filtered true
X-IronPort-Anti-Spam-Result AtIIALRqzU1UXebj/2dsb2JhbACYCI4Bd8VqhhUElDWKRA
Date Fri, 13 May 2011 18:34:55 +0100
From MRAB <python@mrabarnett.plus.com>
User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10
MIME-Version 1.0
To python-list@python.org
Subject Re: Regular Expression for words (with umlauts, without numbers)
References <878vua4mjp.fsf@pcwi7557.uni-muenster.de> <BANLkTinVM0v-Ujku5ZgXYXM0oP6VATEHQg@mail.gmail.com>
In-Reply-To <BANLkTinVM0v-Ujku5ZgXYXM0oP6VATEHQg@mail.gmail.com>
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.12
Precedence list
Reply-To python-list@python.org
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-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1520.1305308103.9059.python-list@python.org> (permalink)
Lines 22
NNTP-Posting-Host 82.94.164.166
X-Trace 1305308103 news.xs4all.nl 41113 [::ffff:82.94.164.166]:45917
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:5314

Show key headers only | View raw


On 13/05/2011 17:14, Tim Chon wrote:
> Hallo Jens,
>
> In current python re module, you have to do something like:
>
> ((?!\d|_\w)+ which uses the negative look ahead to grab all words except
> integers and underscore. Of course, if you turn on the unicode flag re.U
> or use it inline like, (?u) then this will grab your desired umlauts.
>
> I'd actually recommend, however, that if you have an extra 20 minutes,
> to use Regexp 2.7:
> http://bugs.python.org/issue2636
>
> Its a much needed improvement over F.Lundh's re implementation (from
> 1999!) and its 40% faster. Moreover, you can do exactly what you are
> requesting like so,
>
> (?u)[[:alpha:]]+
>
The latest release is here:

     http://pypi.python.org/pypi/regex

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Regular Expression for words (with umlauts, without numbers) MRAB <python@mrabarnett.plus.com> - 2011-05-13 18:34 +0100

csiph-web