javascript check if string contains only certain characters