Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
PowerShell: Automating Administrative Tasks

You're reading from   PowerShell: Automating Administrative Tasks The art of automating and managing Windows environments

Arrow left icon
Product type Course
Published in Feb 2017
Publisher Packt
ISBN-13 9781787123755
Length 737 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (4):
Arrow left icon
Michael Shepard Michael Shepard
Author Profile Icon Michael Shepard
Michael Shepard
Sherif Talaat Sherif Talaat
Author Profile Icon Sherif Talaat
Sherif Talaat
Brenton J.W. Blawat Brenton J.W. Blawat
Author Profile Icon Brenton J.W. Blawat
Brenton J.W. Blawat
Chendrayan Venkatesan Chendrayan Venkatesan
Author Profile Icon Chendrayan Venkatesan
Chendrayan Venkatesan
Arrow right icon
View More author details
Toc

Chapter 5. Regular Expressions

When you are scripting, you will run into situations where you need to validate strings to see if they meet certain criteria. While you have the ability to use comparison operators to view if a string matches a certain value, you don't have the ability to validate parts of a string. A good example is of IP addresses. The comparison operators don't have the ability to validate the syntax of an IP address. If you were to use the normal comparison operators to validate an IP address syntax, you would have to build a script that would split the numerical values, verify that it has 4 octets, validate the individual numerical values, and pass a True or False value. Regular expressions solve this problem by providing deep comparison operations in a single string to verify that strings meet certain criteria.

In this chapter, you will learn about:

  • Common metacharacters
  • Grouping constructs and ranges
  • Regular expression quantifiers
  • Regular expression anchors...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime