Link Details

Link 136918 thumbnail
User 254199 avatar

By KlausG
via tellingmachine.com
Published: Nov 26 2008 / 15:53

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.
  • 12
  • 0
  • 1126
  • 261

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (12)



Voters Against This Link (0)