bug: remove upto a match, not all matches