This Gist was automatically created by Carbide, a free online programming environment.
Created
November 6, 2017 01:35
-
-
Save carbide-public/fe58117eb539d6dea45a68822dd188e9 to your computer and use it in GitHub Desktop.
untitled
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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