repocrypts / Validator

Client-side javascript validator library ports from Laravel 5.2
MIT License
46 stars 22 forks source link

regex bug #14

Closed prashant-saxena closed 4 years ago

prashant-saxena commented 5 years ago

Hi,

I have a rule defined like this:

'tags': ['required','between:3,100','regex:/^[a-z0-9, ]+$/'],

The problem is because of comma ',' character. In validateMatch function, where let re = params[0]

line is there, actual param value is Array [ "/^[a-z0-9", " ]+$/" ]

and you are using param[0], that's why it's throwing

unterminated character class

error.

jfstn commented 4 years ago

This will not be fixed. You are free to open a PR anyway.