The answers given seem like they would work well if you know how to script. KiCommand is intended to give a slightly simpler access to KiCad.
I'm inspired by this post to add regular expression filtering to KiCommand, and I also had to add the ability to create boolean arguments. In the development version of KiCommand, the following command sets the visibility flag on matching reference designators.
Please let me know if this would be of use to you, and I can accelerate the release of this version.
modules copy GetReference call .*EF.* regex isnotnone filter Reference call false SetVisible callargs
Walking through the commands:
-- gets all modules on the board, and duplicates on the stack (the copy is for later use in this command string).
-- STACK: ModuleList, ModuleList
-- gets the reference text of each module
-- STACK: ModuleList, ListOfReferenceStrings
- .*RE.* regex isnotnone
-- creates a list of True/False values corresponding to matching list elements
-- STACK: ModuleList, TrueFalseList
-- filters the module list based on the True values in the TrueFalseList (uses the extra copy of ModuleList created in the copy command above.
-- STACK: ModuleListMatchingRegex
-- get the reference graphic objects of the modules
-- STACK: MatchingReferenceObjects
false SetVisible callargs -
-- set the visible parameter of the reference objects to false (invisible)
Based on how often the utility of getting modules matching a specific regular expression, I'll probably create convenience commands to reduce this to something like:
modules .*EF.* regexref refobj clearvisible