matchAllかwhile regex.exec(string) !== null