I\'ve got the following HTML5 form: http://jsfiddle.net/nfgfP/
The easiest and cleanest way I've found is to use a data attribute to store your custom error. Test the node for validity and handle the error by using some custom html.
le javascript
if(node.validity.patternMismatch) { message = node.dataset.patternError; }
and some super HTML5