I have the following string
$FileNamePattern = 'blah_{4}_{5}_blah_{4}-{2}.CSV'
and I want to replace the numbers in the curly braces with a string of question marks, n characters long
As an example I would like it to return 'blah_????_?????_blah_????-??.CSV'
I have this so far, but can't seem to get the 'expansion' in the replace working
[regex]::Replace($FileNamePattern,'{(\d+)}','"?"*$1')
Any help would be greatly appreciated!
Matthew
