且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

20个字符的字母数字值的正则表达式,后一个F

更新时间:2022-06-14 21:20:27

使用js
use js
function ValidTxt(txt)
    {
        //alert(txt.value);
        var reg = new RegExp("[A-Z][0-9]{19}[F]");
        if(txt.value != '')
        {
            if(!reg.test(txt.value) || txt.value.length != 20)
            {
                alert('Not in correct format.');
                txt.focus();
                return false;
            }
        }
        return true;
    }