There's the ProxyPassMatch directive, but it does specify the following restriction:
The URL argument must be parsable as a URL before regexp substitutions (as well as after). This limits the matches you can use. For instance, if we had used
ProxyPassMatch ^(/.*.gif)$ http://backend.example.com:8000$1
in our previous example, it would fail with a syntax error at server startup. This is a bug (PR 46665 in the ASF bugzilla), and the workaround is to reformulate the match:
ProxyPassMatch ^/(.*.gif)$ http://backend.example.com:8000/$1
I don't know if it will accept http://$1.targetserver.com as a valid URL before substitution -- try it out and let us know!
As mentioned by Shane, you could also use mod_rewrite, but you should be aware that the proxying done by mod_rewrite does not use connection pooling -- each new request will create a new proxy connection on the fly. Therefore you will not be able to benefit from the persistent connection pooling done by ProxyPass, nor will you able to fine-tune its behaviour with the per-connection-pool options that ProxyPass provides (keepalive, timeout, connectiontimeout, retry, min/max, etc.).
Note that there doesn't appear to be a matching ProxyPassReverseMatch directive for either alternative.