Showing tag results for Thomas Rayner

Oct 21, 2016
Post comments count0
Post likes count0

PowerTip: How to use regular expressions to split a string without losing the character you split on

Doctor Scripto

Summary: Cloud and Datacenter Management MVP, Thomas Rayner, shows how to split a string without losing the character you split on. I’m splitting this file name some file.txt into its name and extension by going “some file.txt” –split “.”. It’s giving me some file and txt, but I want to keep the dot and get .txt instead. How can I do this? You c...

Windows PowerShellPowerTipguest blogger
Oct 21, 2016
Post comments count0
Post likes count2

PowerShell regex crash course – Part 4 of 5

Doctor Scripto

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 & Datacenter Management Microsoft MVP, filling in for The Scripting Guy! this week. You can find me on Twitter (@MrThomasRayner), or posting on my blog, workingsysadm...

Windows PowerShellguest bloggerThomas Rayner
Oct 14, 2016
Post comments count0
Post likes count0

PowerTip: How to detect a valid Active Directory user name using regular expressions

Doctor Scripto

Summary: Cloud and Datacenter Management MVP, Thomas Rayner, shows how use regex to detect if a string is a valid Active Directory user name. The invalid characters for an Active Directory user name are and . How do I tell if a string is a valid Active Directory user name?   You can treat this array of characters as a pattern and see if t...

Windows PowerShellPowerTipguest blogger
Oct 14, 2016
Post comments count0
Post likes count1

PowerShell regex crash course – Part 3 of 5

Doctor Scripto

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, workingsysa...

Windows PowerShellguest bloggerThomas Rayner
Oct 7, 2016
Post comments count0
Post likes count0

PowerTip: How to detect phone numbers using regular expressions

Doctor Scripto

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

Windows PowerShellPowerTipguest blogger