Skip to content

Instantly share code, notes, and snippets.

@carbide-public
Created November 6, 2017 01:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carbide-public/fe58117eb539d6dea45a68822dd188e9 to your computer and use it in GitHub Desktop.
Save carbide-public/fe58117eb539d6dea45a68822dd188e9 to your computer and use it in GitHub Desktop.
untitled
function is_valid_group_name(group_name) {
//@*null確認*@
if(group_name == null){
//@*nullは許可しない*@
return false;
}
//@*空文字確認*@
if(group_name != "") {
//@*空文字は許可しない*@
return false;
}
//@*グループ名禁止文字列リストを1つずつ確認していく*@
for(var i = 0; i < group_name_invalid_string_list.length; i++)
{
//@*確認対象のグループ名に禁止文字列が含まれている場合は許可しない*@
if(group_name.match(group_name_invalid_string_list[i])) {
return false;
}
}
return true;
}
var group_name_invalid_string_list = ["\|", "\\", ":", "*", "?", "/", ">", "<", "\&", "'"];
var s_str1 = "12345";
var s_str2 = "9";
console.log(is_valid_group_name("\\"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment