h5Validate RegEx – regular espressions patterns

css

.form-valid {
background-color: #ff628d;
color: white;
}

js – regex

	$(document).ready(function () {
		
		// add h5-class to validate fields
		$.h5Validate.addPatterns({
			'codfiscale':    /^([A-Za-z]{6}[0-9lmnpqrstuvLMNPQRSTUV]{2}[abcdehlmprstABCDEHLMPRST]{1}[0-9lmnpqrstuvLMNPQRSTUV]{2}[A-Za-z]{1}[0-9lmnpqrstuvLMNPQRSTUV]{3}[A-Za-z]{1})|([0-9]{11})$/,
			'partitaiva':    /^[0-9]{11}$/
			'phone':    /(^1-[2-9]\d{2}-\d{3}-\d{4}$)|(^\d{2}-\d{2}-\d{3}-\d{4}$)/,
			'datesql':  /^[012][019][0-9][0-9]-[01][0-9]-[0123][0-9]$/,
			'zip5':     /^[0-9]{5}$/,
			'zip9':     /(^\d{9}$)|(^\d{5}-\d{4}$)$/,
			'int':      /^[0-9]*$/,
			'alphanum': /^[A-Za-z0-9]+$/,
			'alpha':    /^[A-Za-z]+$/ 
		});
		
		$('#form_id').h5Validate({
			errorClass:'form-valid' 
		});
	});

Github: https://github.com/ericelliott/h5Validate