Path_reg working

I want to have a URL based redirection like the following pattern

/foo/any_number/bar

Example : /foo/12345/bar

I wrote an acl like this…but it is not working

acl foobar path_reg ^/foo/(.*)/bar

Could you please help on this ?