Created
February 8, 2021 16:28
-
-
Save DBremen/a8882ebd808feea20f32bdb581f11cdd to your computer and use it in GitHub Desktop.
PowerShell example to extract text between delimiters using RegEx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$testText = 'Peter <[email protected]>, Paul <[email protected]>, Zoe <[email protected]>' | |
$pattern = '(?<=\<).+?(?=\>)' | |
[regex]::Matches($testText, $pattern).Value | |
<# | |
output | |
[email protected] | |
[email protected] | |
[email protected] | |
#> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment