I want to replace a date with regex in a file in Powershell. All whitespacing needs to be preserved:

```
#define    BUILD_DATE          20181010

```

The current date is a variable:

```
[string]$Today = Get-Date -UFormat "%Y%m%d"

```

I learned to use backticks when using a match in replace expression:

```
(Get-Content $ItemFullPath) |
Foreach-Object { $_ -replace "(#define\s+?BUILD_DATE\s+?)\S+", "`$1$Today" } |
Set-Content $ItemFullPath

```

But this leads to:

```
#define    BUILD_DATE          $Today

```

I cannot add another space character here. There are other readers and writers of this file which expect that very same whitespace to be present.