It's just a simple helper function, i don't think a subjective argument about replace vs match is relevant here as this is only for the purpose of the demo page.