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)

Date 2011-05-13 18:34 +0100
From MRAB <python@mrabarnett.plus.com>
Subject Re: Regular Expression for words (with umlauts, without numbers)
References <878vua4mjp.fsf@pcwi7557.uni-muenster.de> <BANLkTinVM0v-Ujku5ZgXYXM0oP6VATEHQg@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1520.1305308103.9059.python-list@python.org> (permalink)

Show all headers | 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