Score:0

Haproxy: Is there a way of testing for two occurrences of a character in path without resorting to regex?

ru flag

I'm trying to write an ACL rule for haproxy. I want it to be true for paths that contain two or more forward slashes. Ie:

/ -> false
/test -> false
/test/test -> true

Is there a way of doing this without resorting to regexes?

Score:1
cn flag

As far as I know, it's not possible. Regex is the perfect tool for this. I'd recommend using an online regex tool, so you can test your regex accordingly before changing your ACL rule.

Try https://regex101.com/

ru flag
Thanks, I suspected as much. I try to avoid regexes because of the possible performance implications, but looks like it'll have to do here.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.