O'Reilly logo

Windows PowerShell™ Scripting Guide by Ed Wilson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Unleashing the Power of Regular Expressions

One of the interesting features of Windows PowerShell is the ability to work with regular expressions. Regular expressions are optimized to manipulate text. You've learned about using regular expressions with the switch statement to match a particular word, however, you can do as much with the -wildcard switch. Now you'll learn some of the more advanced tasks you can complete with regular expressions. Table 2-4 lists the escape sequences you can use with regular expressions.

Table 2-4. Escape Sequences

Character

Description

ordinary characters

Characters other than . $ ^ { [ ( | ) * + ? \ match themselves.

\a

Matches a bell (alarm) \u0007.

\b

Matches a backspace \u0008 if in a [] character class; in a regular ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required