Skip to content

Add regex.escape #677

@apainintheneck

Description

@apainintheneck

This would take a string and return a string with all regex-specific characters escaped so that it would match the literal string if compiled to a regex. It would be useful when you want to exactly match part of a string while partially matching other parts a string. I'm not sure how difficult this would be to add though because of the differences between JS and Erlang regex syntax.

fn escape(string: String) -> String

Related:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions