Does anybody determine if you can use regex capture within Apache's DirectoryMatch directive? Let me make a move such as the following:

<DirectoryMatch ^/home/www/(.*)>
    AuthType Basic
    AuthName $1
    AuthUserFile /etc/apache2/svn.passwd
    Require group $1 admin

but to date I have didn't have success.

Particularly, I am trying to produce a group-based HTTP Auth for individual sites/vhosts on the server in Apache 2..

For instance, Site A, pointing to /home/www/a is going to be open to all customers in group admin and group a, site b at /home/www/b is going to be open to all customers in group admin and group b, etc. Let me keep everything in line with the directory title in order to easily script adding htpasswd customers towards the correct groups and automate this whenever possible, but other recommendations for fixing the issue are extremely welcome.

You can tackle the issue from the different position: let the perl module and you will incorporate a little perl script inside your httpd.conf. You can then make a move such as this:

my @groups = qw/ foo bar baz /;
foreach ( @groups ) {
    push @PerlConfig, qq| <Directory /home/www/$_> blah </Directory> |;

This way, you can even read your groups along with other information from the database or simply by globbing /home/www or other things you crave to eat.

What you're attempting to do looks much like per-user home directories. The way in which Apache handles these is thru file system permissions and .htaccess files. I do not believe there's in whatever way to make use of regex capture within the enclosed directives (AuthName, etc).