用户注册帐号要求:
长度为6-12位
首字母必须大写,在数字加英文组合的情况下,英文字母必须是2个以上才能注册
------解决方案--------------------
- HTML code
<!DOCTYPE HTML>
<html>
<head>
<meta charset="gb2312" />
<title></title>
<style>
</style>
</head>
<body>
<script>
var s = 'A123d12d3';
var re = /^(?=[a-zA-Z\d]{6,12}$)[A-Z][a-zA-Z\d]*[a-zA-Z][a-zA-Z\d]*$/;
document.write( re.test(s) )
document.write('<br/>')
document.write( s.match(re) )
</script>
</body>
</html>