match and flag