$('#myForm').validate({ rules: { 'myField': { myRule: function(element) { var re = new RegExp(regexp); return re.test(element); } } } });