title: powershell regex filename matching
body: <p>I'm new to using both powershell and regex but think it's the solution to verifying filename formats in a folder. The filenames should typically look like... </p>
  
  <p>"01234 - Corres - Example title of my study - 2015-12-03.msg"</p>
  
  <p>and using this script to do the matching...</p>
  
  <pre><code>$MyStudyPath = "C:\Users\higginsr4\Test\StudyExamples\SmallMsgFolder"
  $MyStudyNumber = "06327"
  #Get-ChildItem -path $MyStudyPath -filter *.msg | where-object {$_.Name -match $($MyStudyNumber+' - corres - *' + '\d\d\d\d-\d\d-\d\d.msg')}
  Get-ChildItem -path $MyStudyPath -filter *.msg | where-object {$_.Name -match $($MyStudyNumber+' - corres - *')}
  </code></pre>
  
  <p>This code line...</p>
  
  <pre><code>Get-ChildItem -path $MyStudyPath -filter *.msg | where-object {$_.Name -match $($MyStudyNumber+' - corres - *')}
  </code></pre>
  
  <p>works fine but I'd like to be able to use the regex wildcard to match any "Example title of my study" followed by matching the date using regex with syntax in the commented out line in the above script. Problem is that this commented out line doesn't match anything and struggling to resolve the problem with matching the date using regex.</p>
  
  <p>Any help appreciated...</p>