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


Groups > comp.lang.python > #91723 > unrolled thread

Pyton re module and POSIX equivalence classes

Started byTim Chase <python.list@tim.thechases.com>
First post2015-06-01 15:29 -0500
Last post2015-06-01 15:29 -0500
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  Pyton re module and POSIX equivalence classes Tim Chase <python.list@tim.thechases.com> - 2015-06-01 15:29 -0500

#91723 — Pyton re module and POSIX equivalence classes

FromTim Chase <python.list@tim.thechases.com>
Date2015-06-01 15:29 -0500
SubjectPyton re module and POSIX equivalence classes
Message-ID<mailman.21.1433195168.13271.python-list@python.org>
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




[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web