This can be done using a simple Access Control List (ACL). However, This wasn't possible up until Haproxy 1.6 (October 2015), where you can include this option in your frontend:
option http-buffer-request
This option gives Haproxy access to the body. Then you can use req.body to access the body. Example:
frontend http-in
bind *:80
option http-buffer-request
acl redirect_pingpong req.body -m reg [insert your regular expression here]
use_backend pingpong_backend if redirect_pingpong
default_backend web_bk
And then go on to define your backends.
Further information on accessing body content can be found here and information about ACLs can be found here.