[04.30.22] Coding test

Juyeon.it·2022년 4월 30일
0

Coding test

목록 보기
19/32

Not very secure

Description

In this example you have to validate if a user input string is alphanumeric. The given string is not nil/null/NULL/None, so you don't have to check that.
The string has the following conditions to be alphanumeric:
At least one character ("" is not valid)
Allowed characters are uppercase / lowercase latin letters and digits from 0 to 9
No whitespaces / underscore

My answer

function alphanumeric(string){
  return /^[0-9a-z]+$/i.test(string);
}

0개의 댓글

관련 채용 정보