agent: move tags filtering regexp out of members loop

Sorry for the extra PR - I didn't move the tags regex compilation out of the members loop like I should have in #164.