Skip to content

possibly Invalid pattern for Passphrase #480

@commonism

Description

@commonism

The regex

          pattern: (^[ !#-~]+$)|(^Passphrase:[ ^[ !#-~]+$)|(^Hex:[0-9A-Fa-f]{24})|(^\*+$)
          pattern: (^[ !#-~]+$)|(^Passphrase:[ ^[ !#-~]+$)|(^Hex:[0-9A-Fa-f]{24,96})|(^\*+$)
          pattern: (^[ !#-~]+$)|(^Passphrase:[ ^[ !#-~]+$)|(^Hex:[0-9A-Fa-f]{32})|(^\*+$)

are considered invalid by rust regex.

  SchemaError: regex parse error:
    (^[ !#-~]+$)|(^Passphrase:[ ^[ !#-~]+$)|(^Hex:[0-9A-Fa-f]{24,96})|(^\*+$)
                              ^
error: unclosed character class

It's accepted by python re.

Yet I think it lacks an escape for the [ in ^[

(^Passphrase:[ ^\[ !#-~]+$)

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