Skip to content

New regex flavor targeting Python's regex moduleΒ #87

@Aloso

Description

@Aloso

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 support
  • PythonRegex, the better third-party library with good Unicode support

In the CLI, -f python should alias to python-re, but issue a warning.

In the PythonRegex flavor, many other things also work that aren't supported in PythonRe:

  • Unicode properties
  • Grapheme matcher
  • Atomic groups
  • Character set intersection and subtraction

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-flavorsIssues about adding or modifying flavorsC-languageIssues regarding Pomsky's syntaxenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions