Optional trailing slash in Page Rules redirect

:wave: I have a redirect configured that maps /*/* to /$1-$2.

This works great for a URL like /a/b, resulting in it going to /a-b as expected. However, as soon as I introduce a trailing slash it breaks, with /a/b/ going to /a/b- (it seems like the first * starts matching a/b, and then the second * matches nothing after the last /).

This makes sense in the context of * being greedy, which I’ve asked about before. But, this is incredibly frustrating for wanting to have a consistent redirect experience for users, whether they request a URL with a trailing slash or not.

It seems like the only way to get around this is to add an entire second page rule to handle the case of /*/*/ specifically, redirecting it to /$1/$2 as well. I’d really like to avoid adding another page rule here, it seems very excessive.

Is there a way to make * match one or more characters rather than zero or more characters, or it is possible to include an optional trailing slash in the rule, or is there some other way to normalize requests before they hit this page rule so that a trailing slash doesn’t break it?