Question: The title says it all. Just to add that the number can be multiple digits.

I'm using the following function:

```
str_replace( "/^\&DaysAgo=d+$/", "", $save_query);

```

Answer: 
For anyone else that has this issue that might be in the same way that I had it. I had the exact same problem, but not quite with the same stack traces as defined above. 

My problem was that I didn't have MongoDB installed/running, and that caused it to hang, throwing many errors in the logs. Doing a simple install and a couple setup commands with the pre-defined connection strings seemed to kick it into gear just fine.
It worked for me after I have given write permissions to IIS\_IUSRS for website folder on Inetpub. 

Its bit strange as I already got full permissions to APPPooluser on website folder.