function solution(new_id) {
let answer = '';
answer = new_id.toLowerCase().replace(/[^\-|\_|\.|\w]/g, '').replace(/\.+/g, '.').replace(/^\.|\.+$/, '');
if(answer.length == 0) {
while(answer.length < 3){
answer += 'a';
}
}
answer = answer.slice(0, 15);
if(answer.charAt(answer.length - 1) == '.') answer = answer.slice(0, -1);
if(answer.length <= 2) {
while(answer.length < 3){
answer += answer.charAt(answer.length - 1);
}
}
return answer;
}
성공