javascript check string only contains certain characters