Simple play icon Course
Skills

Windows PowerShell and Regular Expressions

by Jeff Hicks

If you are a PowerShell Pro who needs to know what regular expressions are and how to take advantage of them in PowerShell, then this course is for you. Learn the regex fundamentals, from matching, splitting, replacing, to turning text into objects.

What you'll learn

Many IT Pros, at least those from the Windows world, think regular expressions are hard, or don't know why they might want to use them. Why bother learning and using them in your PowerShell scripting or even at a console prompt? In this course, Windows PowerShell and Regular Expressions, you will learn the key regular expression concepts and techniques that you can immediately put to use in PowerShell. You don't need to know and learn everything about regular expressions, just enough to get started. First, you will discover the basic syntax to create a regular expression pattern. Next, you will learn how to use these patterns in PowerShell. Finally, you will explore how to incorporate regular expressions into your PowerShell scripting. When you are finished with this course, you should have a better understanding of how regular expressions work, how to build them, and how to use them in PowerShell to make you not only a better scripter, but also a better IT professional.

Table of contents

Course Overview
1min

Course FAQ

What is PowerShell Regex?

PowerShell Regular Expression (regex) is a sequence of characters, or a pattern, to help you match or find text using a special syntax. It can be made up of characters, operators, and other constructs to help you search, edit, or manipulate text and data.

What are some examples of regex in use?

Below are a few examples of regex and the types of results it should return:

  • colou?r                     text that contains {color, colour}
  • go*gle                       text that contains {ggle, gogle, google, gooogle, goooogle,...}
  • z{3,6}                        text that contains {zzz, zzzz, zzzzz, zzzzzz}
  • gr[ae]y                      text that contains {gray, grey}
  • rege(x(es)?|xps?)     text that contains {regex, regexes, regexp, regexps}
  • ^dog                          text that begins with "dog"
  • dog$                          text that ends with "dog"
What will I learn in this course?

In this PowerShell Regular Expression course you will learn the key regular expression concepts and techniques that you can immediately put to use in PowerShell, including:

  • What regex is and why you should care
  • How to build regular expression commands
  • Regex objects
  • Parsing with PowerShell and regular expressions
  • Much more!
Who should take this course?

If you are a PowerShell Pro who needs to know what regular expressions are and how to take advantage of them in PowerShell, then this course is for you! Anyone interested in learning PowerShell regular expressions will benefit from this course.

Are there prerequisites to this course?

Before taking this PowerShell regex course you should already be familiar with PowerShell fundamentals.

About the author

Jeffery Hicks is a veteran IT Pro with 30 years of experience, much of it spent as an IT infrastructure consultant specializing in Microsoft server technologies with an emphasis in automation and efficiency. He is a multi-year recipient of the Microsoft MVP Award. He works today as an independent author, teacher, and consultant. He has been creating Pluralsight content for over 10 years. Jeff has written for numerous online sites and print publications, and speaks frequently at technology confer... more

Ready to upskill? Get started