Skip to content

Add beginning-of-match anchor #25

@m-ender

Description

@m-ender

Add an anchor which matches at the first position of the match. This can be useful to asserting a relative position while in a lookaround. For instance, it could have saved 6 bytes in this code. It should be possible to patch this into Retina, by simple string pre-processing of the regex.

If such an anchor is present, prepend

(?=(?<MyAnchor>[\s\S]*))

to the pattern. The anchor itself can then be replaced by

(?=\k<MyAnchor>\z)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementregex-preprocessorFeatures that would require transpiling a custom regex syntax to the .NET flavour.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions