showing results for - "how to pass custom regex in jquery validation"
María Fernanda
03 Apr 2017
1$("#Textbox").rules("add", { regex: "^[a-zA-Z'.\\s]{1,40}$" })
Roberto
15 Feb 2019
1$.validator.addMethod(
2        "regex",
3        function(value, element, regexp) {
4            var re = new RegExp(regexp);
5            return this.optional(element) || re.test(value);
6        },
7        "Please check your input."
8);