E-Mail 确认
var pattern:RegExp =
/([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}/;
var str:String = "cwchiu@hotmail.com";
trace( pattern.test(str) ); // true
str = "a.b.c.d";
trace( pattern.test(str) ); // false
固话确认
var pattern:RegExp = /\d{10}|\d{4}-\d{6}|\(\d{4}\)\d{6}/;
var str:String = "0910-123456";
trace( pattern.test(str) );
str = "0910123456";
trace( pattern.test(str) );
str = "(0910)123456";
trace( pattern.test(str) );
var pattern:RegExp =
/([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}/;
var str:String = "cwchiu@hotmail.com";
trace( pattern.test(str) ); // true
str = "a.b.c.d";
trace( pattern.test(str) ); // false
固话确认
var pattern:RegExp = /\d{10}|\d{4}-\d{6}|\(\d{4}\)\d{6}/;
var str:String = "0910-123456";
trace( pattern.test(str) );
str = "0910123456";
trace( pattern.test(str) );
str = "(0910)123456";
trace( pattern.test(str) );