HAProxy community

Groups possible in Regexs? Alternatives?


So, I have an application that connects via TCP, and the first thing the client sends is a JSON string containing latitude and longitude coordinates. I want to choose the backend based on the lat/lon coordinates.

If I try to create an ACL like this:

acl americas req.payload(0,0) -m reg ‘“lon”: -0*+(?:1[0-8][0-9]|[3-9][0-9]|29).\d{2}.+“lat”: -?0*(?:90|[1-8]?[0-9]).\d{2}’

I get the error: error detected while parsing ACL ‘americas’ : regex ‘“lon”: -0*+(?:1[0-8][0-9]|[3-9][0-9]|29).\d{2}.+“lat”: -?0*(?:90|[1-8]?[0-9]).\d{2}’ is invalid.

Based on trial and error, I can see that the limiting factor is the use of parenthesis (). I can change the statement to no longer use parenthesis by breaking it out into multiple regexs, but is there a better way? Any suggestions?