New regex flavor targeting Python's regex
module
#87
Labels
C-flavors
Issues about adding or modifying flavors
C-language
Issues regarding Pomsky's syntax
enhancement
New feature or request
Is your feature request related to a problem? Please describe.
The
re
module, which is part of Python's standard library, has shockingly poor Unicode support.The biggest issue is that
\w
and\b
don't conform to the Unicode spec, so we can't support them with Unicode enabled. This means that Pomsky is much less useful when targeting Python.The other problem is that people who use the much better
regex
module, can't profit from its good Unicode support when using Pomsky.Describe the solution you'd like
The
Python
flavor is split in two:PythonRe
, the old library from the standard library with poor Unicode supportPythonRegex
, the better third-party library with good Unicode supportIn the CLI,
-f python
should alias topython-re
, but issue a warning.In the
PythonRegex
flavor, many other things also work that aren't supported inPythonRe
:Describe alternatives you've considered
Add a
nonstandard_unicode
mode, so\w
can be used in flavors where\w
matches some non-ASCII word characters, but not all (i.e. Python and .NET). This solves the first problem, but not the second.The text was updated successfully, but these errors were encountered: