I hate regex! (download whitelist related)

I’ve added a Windows Repository and deployed the config setting to all my endpoints. I’ve also added the path to my downloadwhitelist.txt file, but I can’t seem to get the regex syntax right.

My last attempt was just trying to whitelist the root path using:

http://servername.domain.com:52311/.* (That’s not a V, it’s the back/fwd slashes /)

I’ve also read multiple threads trying to explain the correct syntax for this file, but none have panned out. So anyone have a good downloadwhitelist.txt file with an example of how they entered their repository path?

Thanks,
Mike

1 Like

Easiest way to test should be to use the Fixlet Debugger. It looks to me like your regex should work, though escaping the colon isn’t strictly necessary:

q: exists matches(regex "http://servername\.domain\.com:52311\/.*") of "http://servername.domain.com:52311/dir/file.txt"
A: True
T: 0.072 ms
I: singular boolean

I’m not sure whether the regex is case-sensitive in whitelist.txt? Ping me back Monday if you don’t get this resolved before then and I can post an example whitelist.

Actually, never mind. For some reason unknown to me, that syntax worked just fine after the 43rd time I’ve tried it (and yes with restarts of the BESRootServer service in between each one). I just retried the Fixlet and this time it finally “Cached on Server” with literally no change from me in between the last attempt and this one.

Go figure!

Still hate regex though.

P.S. actually that’s not 100% completely true. I did shutdown the server for a couple of days and just happened to bring it back up tonight right before I retried the deployment. So there was that. But other than that…no other change.

Thanks Jason…It seems to be working now…

And yes, I usually don’t escape the colon, but I was at my wits’ end as to what could be causing the URL test to fail so I tried that too. Looks like even though it may not be necessary, it certainly doesn’t hurt to escape it.

Thanks for the reply.

@mxc0bbn You can use this site:

http://regexr.com/

for testing and playing with regular expressions. It will help weed out incorrect syntax and also help in understanding them.

1 Like

Maybe you are killing it with all of those escaping backslashes, here is an example of my whitelist file:

Maybe try an entry in the format of:

http://servername.domain.com:52311/.*

Ninja:

That’s the first method I tried in the whitelist file, restarted the root server and it still failed the check.

In all fairness, so did everything else until I had to go away, powered off the server for a couple of days and then after I powered it back on the last one I tried (which had been failing before) worked all of a sudden.

Something was hung on it I think.

1 Like