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
Mastering Windows PowerShell Scripting

You're reading from   Mastering Windows PowerShell Scripting Automate and manage your environment using PowerShell Core 6.0

Arrow left icon
Product type Paperback
Published in Feb 2019
Publisher Packt
ISBN-13 9781789536669
Length 626 pages
Edition 3rd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Chris Dent Chris Dent
Author Profile Icon Chris Dent
Chris Dent
Arrow right icon
View More author details
Toc

Table of Contents (27) Chapters Close

Preface 1. Section 1: Exploring PowerShell Fundamentals FREE CHAPTER
2. Introduction to PowerShell 3. Modules and Snap-ins 4. Working with Objects in PowerShell 5. Operators 6. Section 2: Working with Data
7. Variables, Arrays, and Hashtables 8. Branching and Looping 9. Working with .NET 10. Strings, Numbers, and Dates 11. Regular Expressions 12. Files, Folders, and the Registry 13. Windows Management Instrumentation 14. HTML, XML, and JSON 15. Web Requests and Web Services 16. Section 3: Automating with PowerShell
17. Remoting and Remote Management 18. Asynchronous Processing 19. Section 4: Extending PowerShell
20. Scripts, Functions, and Filters 21. Parameters, Validation, and Dynamic Parameters 22. Classes and Enumerations 23. Building Modules 24. Testing 25. Error Handling 26. Other Books You May Enjoy

Grouping

A group in a regular expression serves a number of different possible purposes:

  • To denote repetition (of more than a single character)
  • To restrict alternation to a part of the regular expression
  • To capture a value

Repeating groups

Groups may be repeated using any of the quantifiers. The regular expression that tentatively identifies an IP address can be improved using a repeated group. The starting point for this expression is as follows:

[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+ 

In this expression, the [0-9]+ term followed by a literal . character is repeated three times. Therefore, the expression can become as follows:

([0-9]+\.){3}[0-9]+ 

The expression itself is not very specific—it will match much more than an...

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