8
0
Skriptentwickung/test/Regex-test1.ps1
2024-01-24 16:42:38 +01:00

15 lines
434 B
PowerShell

cls
# PowerShell RegEx with Groups as result
# Help from https://mcpmag.com/articles/2015/09/30/regex-groups-with-powershell.aspx
$txt1 = $NULL
$res1 = $NULL
$txt1 = "#SCAN#DD-Eingangsrechnung"
#$res1 = ($txt1 | Select-String -pattern "(?:#SCAN#(DD-[a-zA-Z-üÜöÖäÄ]{1,}))" -AllMatches | %{$_.matches} | %{$_.value})
$res1 = ([regex]::Match("$txt1", "(?:#SCAN#(DD-[a-zA-Z-üÜöÖäÄ]{1,}))").Groups[1].Value)
echo $res1