代码示例:(标识:eg_html5_input_pattern)
<!DOCTYPE HTML>
<html>
<body>

<form action="/index/demo/form_current.html" method="get">
国家代码:<input type="text" name="country_code" pattern="[A-z]{3}"
title="三个字母的国家代码" />
<input type="submit" />
</form>

</body>
</html>
运行结果: