private static const pattern:RegExp = /[\ \{\}\[\]\/?.,;:|\)*~`!^\-_+<>@\#$%&\\\=\(\'\"]/gi
public static function checkSpellForChat(str:String):Boolean
{
var word:String = str.split(pattern).join("");
return checkExist(word);
}
public static function checkSpellForName(str:String):Boolean
{
var word:String = str.split(pattern).join("");
if ( checkExist(word)==true || checkSame( word)==true )
{
return true;
}
return false;
}
public static function checkExist(str:String):Boolean
{
for each(var word:String in existList )
{
if ( str.indexOf(word ) >=0 )
{
return true;
}
}
return false;
}
public static function checkSame(str:String):Boolean
{
for each(var word:String in sameList )
{
if ( word == str )
{
return true;
}
}
return false;
}