<input type="text" id="txtInf" regex="/some regular expression/" error="Inf is mandatory"></input>
here regex and error are custom attributes. Field will be validated against the given regular expression in regex and if the regular expression text fails then error meessage should be shown.
$("*[regex]").each(function () {
$
.validator.addMethod($(this).attr('id'), function () {
return this.optional($(this)) || $(this).attr('regex').test($(this).text());
}, $(this).attr('error'));
});