Replies: 1 comment
-
hey! your regex have to support not only the final state but intermediate states like |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am attempting to use the following for IP Address masking. It works fine in a normal javascript function but does not work with this library. Does IMask not support a valid regex such as this?
/^(?!.)((^|.)([1-9]?\d|1\d\d|2(5[0-5]|[0-4]\d))){4}$/
Javascript function that works fine.
function validateIPAddress(text) {
let regexPattern = /^(?!.)((^|.)([1-9]?\d|1\d\d|2(5[0-5]|[0-4]\d))){4}$/;
let testResult = regexPattern.test(text);
if (testResult == false) {
alert("Not a valid IP Address");
}
}
Beta Was this translation helpful? Give feedback.
All reactions