Skip to content

Idea: compile-time verification of the regular expressions #607

Closed as not planned
@vorner

Description

@vorner

Hello

I know the compile-time regular expressions that were provided by regex-macros are no longer supported. I found them quite an interesting thing.

I was wondering how much work it would be to provide a subset of that functionality. I'm not really worried about runtime allocation or the performance of building the regex at runtime. But being able to validate the regular expression syntax at compile time was a nice thing.

So I was wondering, with proc-macros stabilized, how much work would it be to have just the verification? Basically, the macro would take the string, try to compile it and then spit out the very ordinary Regex::new(string) code in its place.

Does that idea make some sense?

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