Regular Expression Named and Multiple Captures with PowerShell

  Рет қаралды 4,260

Trevor Sullivan

Trevor Sullivan

Күн бұрын

Regular expressions provide a feature called "named captures" that allow you to assign custom names to your match groups. Using named captures helps improve the readability of your code, versus using the index number to refer to regular expression capture groups. We'll explore how you can leverage this feature in your PowerShell scripts.
Additionally, we will also demonstrate how you can perform multiple regular expression matches inside of your text blocks, by leveraging the [regex] type accelerator and the .Matches() method on the regular expression .NET object.
Producer: Trevor Sullivan
Website: trevorsullivan...
Patreon: / trevorsullivan
Twitter: / pcgeek86
Gab: gab.ai/trevors
Intro music "Amen Tune" used, with permission, from Aaron Static. Check out his music here: / aaronstatic
#Microsoft #PowerShell #automation

Пікірлер: 11
@francocicirelli490
@francocicirelli490 2 жыл бұрын
It's a great learning video about regular expressions in powershell. I'm new in powershell and this video is so useful. Thank you trevor. keep going on with your work
@goonbreathfpv
@goonbreathfpv 2 жыл бұрын
You really helped me out! I have been looking for an example of extracting all matches using a regular expression and you provided a clear solution. Thank you very much
@MeiklesAndDimes
@MeiklesAndDimes 4 жыл бұрын
I really appreciate you explaining the basic stuff like what software you are using and how you set it up, and also the keyboard shortcuts.
@DeveloperDesmond
@DeveloperDesmond 4 жыл бұрын
Clean tutorial on a topic I wouldn't've known existed without stumbling on this.
@WindosNZ
@WindosNZ 5 жыл бұрын
I only learnt about capture groups (and named captures) a couple of months back. Literally made that particular segment of a script 1/10th the size using them instead of what I was trying to do. Great video as always!
@karthikkarthik100
@karthikkarthik100 5 жыл бұрын
Thanks a ton for your time, It really helped me
@gururajmeghraj2366
@gururajmeghraj2366 2 жыл бұрын
this is informative. thanks!
@Gett37
@Gett37 2 жыл бұрын
Nice color
@otroleonarbe
@otroleonarbe 4 жыл бұрын
Hi Trevor, Great video, thx for taking the time to explain. Not sure if you have already done anything with search and replace running from a script . I have this scenario: * Raw_File * SearchReplaceScript.ps1 (THis file contains mulitiple replace statements to be applied to Raw_File *Output_File I tried using "replace", it works but from the Powershell command line. However when I run the scripts it does nothing, but no error is generated
@stefanspinu1637
@stefanspinu1637 5 жыл бұрын
Wonderful!!!
@offlinetutorials
@offlinetutorials Жыл бұрын
why do you look like jack dorsey lol
Handling Errors in PowerShell with Try..Catch..Finally
18:48
Trevor Sullivan
Рет қаралды 10 М.
Run Tasks on Timers in PowerShell
17:09
Trevor Sullivan
Рет қаралды 10 М.
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 69 МЛН
If people acted like cats 🙀😹 LeoNata family #shorts
00:22
LeoNata Family
Рет қаралды 45 МЛН
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 154 МЛН
Regular Expressions (Regex) Tutorial: How to Match Any Pattern of Text
37:55
Working with Strings and Regular Expressions in PowerShell
56:29
Chasse TAC
Рет қаралды 1,2 М.
Detecting Text Patterns with PowerShell Regular Expressions
13:02
Trevor Sullivan
Рет қаралды 7 М.
Learn to securely use Passwords with PowerShell
18:13
Shane Young
Рет қаралды 73 М.
PowerShell Unplugged with Jeffrey Snover (The Blueprint Files) | BRK260
1:02:07
PowerShell Quick Tips : RegEx Regular Expressions
32:04
JackedProgrammer
Рет қаралды 2,6 М.
Learn Regular Expressions In 20 Minutes
20:52
Web Dev Simplified
Рет қаралды 1,3 МЛН
2.4: Regular Expressions: Capturing Groups - Programming with Text
13:42
The Coding Train
Рет қаралды 154 М.