Skip to content

format validation with regex containing a dollar sign generates invalid regex #684

@tomca32

Description

@tomca32

We validate format with the following regex:

/\A\$?[\d^0](\d{0,2})(,?\d{3})+\Z/

In the frontend this gets converted into the following string:

^?[\d^0](\d{0,2})(,?\d{3})+(?=\n?$)

which is invalid regex and raises the following error:

Uncaught SyntaxError: Invalid regular expression: /^?[\d^0](\d{0,2})(,?\d{3})+(?=\n?$)/: Nothing to repeat

This is due to the following bug in JSRegex dependency: jaynetics/js_regex#2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions