Are you wrapping your expression in quotes? This indicates that Matches only accepts strings as the pattern. If that doesn't work I'm really not sure what the issue is, and I would try to pass your values to a custom function where you can examine what's really going on, and see if you can replicate the problem. This is essentially what Jeffrey Drumm was suggesting.

Have you been able to reproduce this in essentially an empty delegated web app? If it works there then we know it's probably just a logic problem with your code.

The next thing I would try for nailing down the culprit is looking at where the 401 is generated. %CSP.Rest on its own contains two functions that output 401 errors, Page and Login. I'm brainstorming now, but if it's coming from Page, I'd think your logic is trying to load something after being logged out (a login page it can't find maybe?), and if it's from Login, that'd be odd to me but probably something in your logic trying to immediately log back in with empty or bad credentials.

If you're able to see those 401 calls being fired in the rest class, try overriding the functions and capturing more information from them to see what's really going on and why they're being called with improper authentication.

Oops! Sorry I forgot it was for a rule. Also edited for redundancy as I see there's more comments now. Does the visual expression editor give any indication of failure?

I use a similar setup with some projects, albeit not with delegation. But appending the param to my url has never given me 401 messages. What kind of permissions do you have setup for your web app? If you manually insert this param at any point in the app, does it always give 401? Are you still redirected to your login page? Where are you capturing the 401, or is it sent on its own?

What do you mean you're not having luck? For example, what happens when you call on the $match or $locate functions on your field? I can make regex on your three examples without issue for simple strings, like below which works:


I've never seen anything like that in the docs before, just working with either regex or the pattern match operator. To get what you're looking for you may very well have to make those extra calls. Alternatively a cool project would be to make your own converter.  That'd be pretty interesting to do,  but before I'd look into it I'd like to make sure there isn't some function out there I've never heard of in Cache that does it. It never ceases to amaze me how many obscure functions exist out there for Cache that I have yet to discover.

Hey, I think these are still glitched for me. The commenter and question posting badges and also the corresponding challenges are never unlocking for me, after over a week of activity.