javascript check if a string contains certain characters