Trouble creating rewrite rule

Hi Guys,
I’m trying to convert a Rewrite Rule from httpd to haproxy, and can’t firue out a solution, maybe somebody here can halp me?

The Rule looks like that:
RewriteCond %{REQUEST_FILENAME} “.*/foo_.*”
RewriteRule ^(.*)/foo_(.*)$ https://www.otherhost.de/foo$1/$2 [NC,L,R=301]

It basically changes

https://www.host.de/bla/foo_blablub
to
https://www.otherhost.de/foo/bla/blablub

I’ve been experimenting with reqrep, but no success so far.