Skip to content
This repository was archived by the owner on Jul 1, 2020. It is now read-only.
This repository was archived by the owner on Jul 1, 2020. It is now read-only.

Regex problem with / #63

@eduardmartinez

Description

@eduardmartinez

Hi. First at all thanks for this great package. It has saved my life.

Going right to the point, I was trying to use 'pattern' option to allow slashes but it throws an error and cuts the expression. For example:

<input type="text" id="mytext" name="mytext" validation="pattern=/^[0-9\s.\/()-+]+$/:alt=Error in expression" />

The error says:

Invalid regular expression: /^[0-9\s.\/: \ at end of pattern

I'm using backslash to escape slash into the expression. But the slash inside is cutting the expression and doesn't recognize the escaping.

Is there anyway to fix this, please? or In which way could I extend the service or something in order to add a new regular expression but without passing it as string?

Sorry for my bad english. Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions