Implements the HTML5 pattern attribute for regular expression input validation