var pattern:RegExp = /^([a-z]{1})([0-9]{9})/;
var str:String = humanID.text;
if(!pattern.test(str)){
Alert.show('身分證不符合格式');
return;
}
var str:String = humanID.text;
if(!pattern.test(str)){
Alert.show('身分證不符合格式');
return;
}
reference
http://livedocs.adobe.com/flex/3/html/help.html?content=12_Using_Regular_Expressions_11.html
沒有留言:
發佈留言