$httpBackend.whenGET(/api\/product\/[a-zA-Z0-9]{6}/).respond(function(data) {
// Code to find given ID in collection
});
When I call this endpoint, I should return the product that matches the given product ID (the regex value). How do I access this value? The data value just equals 'GET'.
I'm assuming you're using $httpBackend in a unit test. If that's so, you have two options. You can choose to use respond to define custom responses (which is what you are doing above).
Or you could use the passThrough method, which should actually call the API (which then makes your tests slightly more volatile as they are not self-reliant, a service interruption could cause the test to fail).
You can read about the .get (including whenGET) and .passThrough methods on the AngularJS $httpBackend documentation.
EDIT
$httpBackend.whenGET(/api\/product\/[a-zA-Z0-9]{6}/)
.respond(function(method, url, data, headers) {
/** do something with url */
});