Skip to main content
PowerShell

PowerShell Making Regular Expressions EASY

By February 26, 2014September 12th, 2022No Comments

I think often when we talk of Regular Expressions or RegEx fear can be felt through the room and corridors feeding to it. I do agree that sometimes when we look at a competed Regular Expression it does rather resemble cartoon characters swearing at each other as there really does not seem to be enough real characters to make much sense. A lot is in how we right the RegEx, we can write the same expression in many ways such as d for or digit or we can write it as [0-9]. Probaly, and this taste, [0-9] is more readable alt although a little longer. The great thing with Regular Expressions is once we can understand them then they are consistent across many Languages including PowerShell. In this tutorials we will validate some data, UK Post-Codes. In doing so we will also learn how to use the read-host cmd-let to populate variable interactively