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: 
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.
Navigate to `inetpub\wwwroot\newsxa[Your file]\Website\App_Config\Include` 
where you will find `Sitecore.Xdb.config in line 8` 

```
<setting name="Xdb.Enabled" value="true" />

```

Just make it false

It will install after that.