Also remove groups from the list when string does not match anything.