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


Groups > fr.comp.lang.regexp > #196

Propriétés Unicode dans les regex Python

From Olivier Miakinen <om+news@miakinen.net>
Newsgroups fr.comp.lang.python, fr.comp.lang.regexp
Subject Propriétés Unicode dans les regex Python
Followup-To fr.comp.lang.python
Date 2022-11-05 18:53 +0100
Organization There's no cabale
Message-ID <tk67uo$1b37$1@cabale.usenet-fr.net> (permalink)

Cross-posted to 2 groups.

Followups directed to: fr.comp.lang.python

Show all headers | View raw


[diapublication avec f.c.l.regexp, suivi vers f.c.l.python]

Bonjour,


Je viens de me rendre compte que dans Python 3.8.10 les propriétés Unicode
\p{xx} et \P{xx} ne sont pas supportées dans les regex :

<https://www.pcre.org/original/doc/html/pcresyntax.html#SEC4>
<https://www.pcre.org/original/doc/html/pcresyntax.html#SEC5>


J'obtiens :
  File "/usr/lib/python3.8/sre_parse.py", line 426, in _escape
    raise source.error("bad escape %s" % escape, len(escape))
re.error: bad escape \p at position 0


Est-ce que quelqu'un sait si c'est supporté dans une autre version de
Python, ou s'il est prévu que ça le soit un jour ?


Cordialement,
-- 
Olivier Miakinen

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


Thread

Propriétés Unicode dans les regex Python Olivier Miakinen <om+news@miakinen.net> - 2022-11-05 18:53 +0100

csiph-web