javascript check if string contains only specific characters