When you want to extract some text from a string, regular expressions come to the rescue. There are a few different ways of using regular expressions in PowerShell, but the -match operator is arguably the easiest. We'll take a look at how to use the -match operator to evaluate regular expressions against singleton and array string values. We'll also explore the built-in $matches variable, which gets populated when you have a positive match against a singleton string value, using the -match operator. In PowerShell, you can read the manual page for regular expressions, using this command: Get-Help -Name about_Regular_Expressions
Here's the web-based version of the documentation:
Apologies for cropping off my head. I will fix this for future videos!
Producer: Trevor Sullivan
Website:
Patreon:
Twitter:
Gab:
Intro music "Amen Tune" used, with permission, from Aaron Static. Check out his music here:
#Microsoft #PowerShell #automation

0 Comments