terminate matcher loop when match is found