PHP Class for the HTML5 Pattern attribute Regex