You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, i'm trying to validate an ip adress, and i'm using a regexp type of rule. But i get an error: Uncaught SyntaxError: Invalid regular expression: /^(25[0-5/: Unterminated character class.
I opened the function that throws an error, copied it and tried to check my regexp by myself and it worked fine, no errors.
My regular expression: regex:/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\/(\\d){1,2})?$/
I've tried to check within this function:
`regex: function (val, req) {
let reqPattern = req;
var mod = /[g|i|m]{1,3}$/;
var flag = req.match(mod);
flag = flag ? flag[0] : "";
Hi, i'm trying to validate an ip adress, and i'm using a regexp type of rule. But i get an error:
Uncaught SyntaxError: Invalid regular expression: /^(25[0-5/: Unterminated character class.
I opened the function that throws an error, copied it and tried to check my regexp by myself and it worked fine, no errors.
My regular expression:
regex:/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\/(\\d){1,2})?$/
I've tried to check within this function:
`regex: function (val, req) {
let reqPattern = req;
var mod = /[g|i|m]{1,3}$/;
var flag = req.match(mod);
flag = flag ? flag[0] : "";
},`
I am willing to figure out, what is going wrong here
I'm using 3.22.1 version of validator js
The text was updated successfully, but these errors were encountered: