I think the tab should just store the icon name it last added in an instance variable and just remove that instead of using a regex which could have unintended effects.