Skip to content

Fix nonewlines mode #76

@trishume

Description

@trishume

As noted in #34 (comment), nonewlines mode uses \z in character classes, but that just acts as z and not end of string. This presents a few problems:

  • Patch it so nonewlines doesn't mess up in the presence of z.
  • Act properly in terms matching the end of the string, this may require more advanced regex syntax rewriting rather than just running regex replacements on regexes.

Specifically, this line needs to be fixed to do a proper replacement strategy that doesn't replace \n with \z when the \n is in a character class, and maybe replaces the character class with (?:[...]|\z) where ... is everything that was in the character class except the \n. This probably would also need a different rewrite for inverted character classes.

cc @robinst

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions