"Acl utls work with variables", How can I select exact variable with value to choose HAProxy backend?

Good time of a day dear community members and staff. A problem with selecting the backend using variables and their value. For example, there is URL like " http(s)://domain.local/geoserver/gwc/service/wmts?layer=somelayer&style=somestyle "


acl srv1 urlp_reg(layer) (Geointellect)
acl srv2 urlp_reg(style) (somestyle)

use_backend srv1_back if srv1
use_backend srv2_back if srv2

Might be I did not understand fully the dilemma, can you provide a solution.

Best regards bottt.