Uri rewrite , append

Hello everyone. I need to rewrite the incoming uri/path if it matches.
like if incoming path start with /test/*** then change this to /test/testing/**

Basically, we are appending /testing/into the path and keeping everything else before sending the request to the backend member.
ChatGPT gave me this one, but my proxy is not taking it.

http-request set-path %[path,regsub(^/test/(.*),/test/testing/\1)]

any help would be appreciated

Can you elaborate what “is not taking it” means?