I\'m trying to match an url with a regex. But the follwing regex doesn\'t match.
$httpBackend.whenGET(\'/^rest\\/find-reservations\\?.*/)\').respond(function
There are two problems with your code:
Enclosing an expression in '...' makes it a string (even if it looks like a regular expression.
You must include the leading / in your pattern.
Your code should be modified like this:
$httpBackend.whenGET(/^\/rest\/find-reservations\?.*/).respond(function () {
return [200, 'success', {}];
});