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


Groups > comp.lang.python > #91729

Re: Pyton re module and POSIX equivalence classes

Path csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'url:pypi': 0.03; 'classes,': 0.05; 'from:addr:yahoo.co.uk': 0.05; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:module': 0.09; 'python': 0.11; 'exception': 0.13; "'a',": 0.16; '-tkc': 0.16; 'awk': 0.16; 'posix': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'wrote:': 0.16; "wouldn't": 0.16; 'module,': 0.18; 'tend': 0.18; 'language': 0.19; 'thanks,': 0.19; '>>>': 0.20; 'lawrence': 0.22; 'recognize': 0.22; 'tried': 0.24; 'header:In-Reply-To:1': 0.24; 'tim': 0.24; 'url:bugs': 0.24; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'gnu': 0.27; "doesn't": 0.28; 'chase': 0.29; 'perl': 0.29; 'character': 0.29; "skip:' 10": 0.30; 'supposed': 0.31; 'knows': 0.32; '[1]': 0.32; 'language.': 0.32; 'url:python': 0.33; 'to:addr :python-list': 0.35; '???': 0.35; 'expected': 0.35; 'but': 0.36; 'url:org': 0.36; 'there': 0.36; '(and': 0.36; 'subject:: ': 0.37; 'received:org': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'mark': 0.40; 'avoid': 0.61; 'our': 0.64; '8bit%:77': 0.84; 'pythonistas,': 0.84; 'treats': 0.84; 'url:2015': 0.91
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: Pyton re module and POSIX equivalence classes
Date Mon, 01 Jun 2015 23:48:54 +0100
References <20150601152930.77f0a8fb@bigbox.christie.dr>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 8bit
X-Gmane-NNTP-Posting-Host host-92-24-215-226.ppp.as43234.net
User-Agent Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0
In-Reply-To <20150601152930.77f0a8fb@bigbox.christie.dr>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.24.1433198954.13271.python-list@python.org> (permalink)
Lines 35
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1433198954 news.xs4all.nl 2949 [2001:888:2000:d::a6]:44350
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:91729

Show key headers only | View raw


On 01/06/2015 21:29, Tim Chase wrote:
> Is Python supposed to support POSIX "equivalence classes"?  I tried
> the following in Py2 and Py3:
>
>    >>> re.sub('[[=a=]]', 'A', 'aáàãâä', re.U)
>    'aáàãâä'
>
> which suggests that it doesn't (I would have expected "AAAAAA" as the
> result).
>
> Is there a way to get this behavior?
>
> I found that perl knows about them but treats them as an exception
> for now[1].  Supposedly GNU awk (and other GNU POSIXish tools)
> recognize character classes, as does vim.
>
> Thanks,
>
> -tkc
>
> [1]
> http://perldoc.perl.org/perlrecharclass.html
>

I wouldn't know directly as I tend to avoid them like the plague, but if 
not are they in the "new" regex module, see 
https://pypi.python.org/pypi/regex/2015.05.28 and/or 
http://bugs.python.org/issue2636 ???

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


Thread

Re: Pyton re module and POSIX equivalence classes Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-06-01 23:48 +0100

csiph-web