Set-var with regex

i want to regsub but i have error
my req.body:

i want to have only valx:testx in my variable:
http-request set-var(txn.myvar) “%[req.body,regsub(‘.+(?<=test1,)(.+)(,val3.+)’,\1,‘g’)]”
i have an error

if i create header:
http-request add-headed myheader “%[req.body,regsub(‘.+(?<=test1,)(.+)(,val3.+)’,\1,‘g’)]”
it’s working

I would like to store variable with the regsub, it is possible

Haproxy 2.6