Scripting Blog [archived]

Formerly known as the "Hey, Scripting Guy!" blog

PowerShell regex crash course – Part 3 of 5

Summary: Thomas Rayner, Microsoft Cloud & Datacenter Management MVP, shows the basics of working with regular expressions in PowerShell. Hello! I’m Thomas Rayner, a proud Cloud & Datacenter Management Microsoft MVP, filling in for The Scripting Guy! this week. You can find me on Twitter (@MrThomasRayner), or posting on my blog, ...

PowerTip: How to detect phone numbers using regular expressions

Summary: Cloud and Datacenter Management MVP, Thomas Rayner, shows how to use regex to detect if a string is a phone number. (image) I have an array like , and I need to know which array items are phone numbers. How can I do this? (image) You can compare each item in the array with all its non-digit characters removed and see if that ...

PowerShell regex crash course – Part 2 of 5

Summary: Thomas Rayner, Microsoft Cloud and Datacenter Management MVP, shows the basics of working with regular expressions in PowerShell. Hello! I’m Thomas Rayner, a proud Cloud and Datacenter Management Microsoft MVP, filling in for The Scripting Guy! this week. You can find me on Twitter (@MrThomasRayner), or posting on my blog, ...

PowerTip: Use a regular expression pattern to remove nonalphabetic characters

Summary: Learn how to use a regular expression pattern to remove non-alphabetic characters from a string by using Windows PowerShell. (image)  How can I use Windows PowerShell to remove non-alphabetic characters from a string? (image)  To remove nonalphabetic characters from a string, you can use the -Replace operator and substitute an ...