Anuradha, do you happen to have a coding background? If yes, then road ahead is fairly simple. You will have to deduce a logic based on your environment, and filter out the the group which you are looking for using few lines of Java code.
Some of the generic logic i could think of:
a) You can manage all the potential group names using a property file and filter out groups at run time by comparing with groups stored in property file.In this way you can always add up new potential groups if needed in to the property and there will be no need to modify the class files.But, drawback with this approach would be, you will have to restart the server every time after property file modification.
b) If you really want things to be totally dynamic, then instaed mainitaining group names in a property file maintain in a custom preference.
But having said that it depends on your data set, what is going to be best for you.