I am almost done with my biggest PowerShell scripting project so far. The last feature that I implemented was a flexible pattern matching facility. I wrote a procedure that would try to filter out a set of file names based on the first letters and the extensions of the file. The possible name prefixes and extensions would be provided by string arrays that could contain zero or more elements. The challenge as always with PowerShell is to understand its type conversion magic. One approach to this is to use baby steps while morphing the static regex string to a dynamically built regex string. This progression and the result is captured in this blog post.